[PR] #58 from lilyinstarlight/fix/empty-pkg-dirs
fix: assume no pkgs when dir is empty or does not exist
This commit is contained in:
commit
0538e02eee
1 changed files with 1 additions and 1 deletions
2
neofetch
2
neofetch
|
@ -1807,7 +1807,7 @@ get_packages() {
|
|||
has() { type -p "$1" >/dev/null && manager=$1; }
|
||||
# globbing is intentional here
|
||||
# shellcheck disable=SC2206
|
||||
dir() { pkgs=($@); ((packages+=${#pkgs[@]})); pac "$((${#pkgs[@]}-pkgs_h))"; }
|
||||
dir() { pkgs=($@); [[ ! -e ${pkgs[0]} ]] && return; ((packages+=${#pkgs[@]})); pac "$((${#pkgs[@]}-pkgs_h))"; }
|
||||
pac() { (($1 > 0)) && { managers+=("$1 (${manager})"); manager_string+="${manager}, "; }; }
|
||||
tot() {
|
||||
IFS=$'\n' read -d "" -ra pkgs <<< "$("$@")";
|
||||
|
|
Loading…
Reference in a new issue