Skip to content

Commit

Permalink
[PR] dylanaraps/neofetch#1642 from rasa - neofetch: Strengthen scoop/…
Browse files Browse the repository at this point in the history
…choco app reporting

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

Co-authored-by: Ross Smith II <[email protected]>
  • Loading branch information
hykilpikonna and rasa committed Aug 12, 2022
2 parents 6c665d9 + 6b43063 commit b0b4ef9
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -1903,13 +1903,28 @@ get_packages() {
MSYS*) has pacman && tot pacman -Qq --color never ;;
esac

ProgramData=$(cygpath --folder 0x0023 2>/dev/null)
if [[ -z "$ProgramData" ]]; then
mount=$(awk '/^C:\s/ {print $2}' /proc/mounts 2>/dev/null)
ProgramData="${mount:-/cygdrive/c}/ProgramData"
fi

# Scoop environment throws errors if `tot scoop list` is used
has scoop && pkgs_h=1 dir ~/scoop/apps/* && ((packages-=1))
has scoop && {
sdir=$(cygpath "$SCOOP" 2>/dev/null)
sdir="${sdir:-$HOME/scoop}"
pkgs_h=1 dir "$sdir"/apps/* && ((packages-=1))
manager=scoop-global
sdir=$(cygpath "$SCOOP_GLOBAL" 2>/dev/null)
sdir="${sdir:-$ProgramData/scoop}"
dir "$sdir"/apps/*
}

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

# Count winget
has winget && tot winget list
Expand Down

1 comment on commit b0b4ef9

@rasa
Copy link
Contributor

@rasa rasa commented on b0b4ef9 Aug 13, 2022

Choose a reason for hiding this comment

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

👍

Please sign in to comment.