Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

neofetch: Strengthen scoop/choco app reporting #1642

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

rasa
Copy link
Contributor

@rasa rasa commented Dec 27, 2020

Description

This PR enhances scoop and chocolatey package reporting, as it:

  1. Uses cygpath to determine where drive C: is mounted (while defaulting to /cygdrive/c).
  2. Finds Scoop's package directories if installed in non-standard directories.
  3. Processes both Scoop's local (user) and system (global) installed packages.
  4. Reports the above package counts separately.
  5. Reports chocolatey's package count separately.

Tested and working in Cygwin, Msys2, git-bash, and WSL environments, where C: is mounted at /c and both %SCOOP% and %SCOOP_GLOBAL% are used.

@dylanaraps
Copy link
Owner

What happens when cygpath is unavailable? (Is it available if CYGWIN is absent? ie, just wsl or msys2 etc).

@rasa
Copy link
Contributor Author

rasa commented Jul 1, 2021

What happens when cygpath is unavailable? (Is it available if CYGWIN is absent? ie, just wsl or msys2 etc).

Cygwin, msys2, mingw, and git-bash environments all have cygpath and /proc/mounts. But if cygpath fails to be found in the path, the code will default to the existing functionality, i.e., using /cygdrive/c/ProgramData.

While wsl runs under Windows, it does not have scoop or choco available, so none of this code is executed.

@rasa
Copy link
Contributor Author

rasa commented Sep 8, 2021

@dylanaraps Why is this PR labeled as "Not mergeable"?

@rasa
Copy link
Contributor Author

rasa commented Nov 7, 2021

@dylanaraps Why is this PR labeled as "Not mergeable"?

@dylanaraps Ping.


# Count chocolatey packages.
[[ -d /cygdrive/c/ProgramData/chocolatey/lib ]] && \
dir /cygdrive/c/ProgramData/chocolatey/lib/*
has choco && dir "$ProgramData"/chocolatey/lib/*

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good. I've previously changed it to has choco && tot choco list --localonly but choco list is really slow (>3s)

hykilpikonna added a commit to hykilpikonna/hyfetch that referenced this pull request Aug 12, 2022
…choco app reporting

Upstream PR: dylanaraps/neofetch#1642
Thanks to @rasa

Co-authored-by: Ross Smith II <ross@smithii.com>
@hykilpikonna
Copy link

Thank you for your contribution!

This PR is merged into hyfetch since this repo (dylanaraps/neofetch) seems no longer maintained.

HyFetch is a fork of neofetch with LGBTQ pride flags, but the repo also maintains an updated version of the original neofetch, addressing many pull requests that are not merged in the original repo.

Read the "Running Updated Original Neofetch" section for more info!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants