pfetch: fix bash 3.2 error

This commit is contained in:
Dylan Araps 2019-09-25 08:53:47 +03:00
parent 0a4a100eb3
commit 4488314f78

13
pfetch
View File

@ -223,7 +223,16 @@ get_pkgs() {
# The output from this is then piped to 'wc -l' to count each # The output from this is then piped to 'wc -l' to count each
# line, giving us the total package count of whatever package # line, giving us the total package count of whatever package
# managers are installed. # managers are installed.
packages=$( #
# Backticks are *required* here as '/bin/sh' on macOS is
# 'bash 3.2' and it can't handle the following:
#
# var=$(
# code here
# )
#
# shellcheck disable=2006
packages=`
case $os in case $os in
Linux*) Linux*)
# Commands which print packages one per line. # Commands which print packages one per line.
@ -267,7 +276,7 @@ get_pkgs() {
command -v pkg_info && pkg_info command -v pkg_info && pkg_info
;; ;;
esac | wc -l esac | wc -l
) `
log pkgs "$packages" >&6 log pkgs "$packages" >&6
} }