From b7e8e39f569b14e31129d00e0162ec1b8d26870e Mon Sep 17 00:00:00 2001 From: Gauge Krahe Date: Tue, 28 Jul 2020 09:22:17 +1000 Subject: [PATCH] check for dirs instead of commands for package counting --- posixfetch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/posixfetch b/posixfetch index df3436d..a98e449 100755 --- a/posixfetch +++ b/posixfetch @@ -3,6 +3,8 @@ # this is my attempt at trying to make a fetch using only posix shell # and as little if none external utilities as I can. # +# shellcheck disable=SC2034 +# ## Terminal @@ -30,14 +32,14 @@ done ## Packages # horribly inefficient, I know. -command -v pacman-key >/dev/null 2>&1 && { +[ -d /var/lib/pacman/local ] && { pkgs=0 for i in /var/lib/pacman/local/*; do pkgs=$(( pkgs + 1 )) done } -command -v xbps-install >/dev/null 2>&1 && { +[ -d /var/db/xbps ] && { pkgs=0 for i in /var/db/xbps/*; do pkgs=$(( pkgs + 1 ))