Skip to content

Commit b0b4ef9

Browse files
hykilpikonnarasa
andcommitted
[PR] dylanaraps/neofetch#1642 from rasa - neofetch: Strengthen scoop/choco app reporting
Upstream PR: dylanaraps/neofetch#1642 Thanks to @rasa Co-authored-by: Ross Smith II <ross@smithii.com>
2 parents 6c665d9 + 6b43063 commit b0b4ef9

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

neofetch

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,13 +1903,28 @@ get_packages() {
19031903
MSYS*) has pacman && tot pacman -Qq --color never ;;
19041904
esac
19051905

1906+
ProgramData=$(cygpath --folder 0x0023 2>/dev/null)
1907+
if [[ -z "$ProgramData" ]]; then
1908+
mount=$(awk '/^C:\s/ {print $2}' /proc/mounts 2>/dev/null)
1909+
ProgramData="${mount:-/cygdrive/c}/ProgramData"
1910+
fi
1911+
19061912
# Scoop environment throws errors if `tot scoop list` is used
1907-
has scoop && pkgs_h=1 dir ~/scoop/apps/* && ((packages-=1))
1913+
has scoop && {
1914+
sdir=$(cygpath "$SCOOP" 2>/dev/null)
1915+
sdir="${sdir:-$HOME/scoop}"
1916+
pkgs_h=1 dir "$sdir"/apps/* && ((packages-=1))
1917+
manager=scoop-global
1918+
sdir=$(cygpath "$SCOOP_GLOBAL" 2>/dev/null)
1919+
sdir="${sdir:-$ProgramData/scoop}"
1920+
dir "$sdir"/apps/*
1921+
}
19081922

19091923
# Count chocolatey packages.
19101924
# [[ -d /c/ProgramData/chocolatey/lib ]] && \
19111925
# dir /c/ProgramData/chocolatey/lib/*
1912-
has choco && tot choco list --localonly
1926+
# has choco && tot choco list --localonly
1927+
has choco && dir "$ProgramData"/chocolatey/lib/*
19131928

19141929
# Count winget
19151930
has winget && tot winget list

0 commit comments

Comments
 (0)