From f310d757d4434272a5bc6959eefd0831217aadf1 Mon Sep 17 00:00:00 2001 From: Adam Jimerson Date: Thu, 11 Aug 2016 06:48:34 -0400 Subject: [PATCH] Switch from if -> case for BSD package counts Signed-off-by: Adam Jimerson --- neofetch | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/neofetch b/neofetch index f3d3aad5..d730839a 100755 --- a/neofetch +++ b/neofetch @@ -695,16 +695,18 @@ getpackages () { ;; "BSD") - # PacBSD has both pacman and pkg, but only pacman is used - if [[ "$distro" == "PacBSD"* ]]; then - packages="$(pacman -Qq --color never | wc -l)" - else - if type -p pkg_info >/dev/null 2>&1; then - packages="$(pkg_info | wc -l)" - elif type -p pkg >/dev/null 2>&1; then - packages="$(pkg info | wc -l)" - fi - fi + case "$distro" in + # PacBSD has both pacman and pkg, but only pacman is used + "PacBSD"*) packages="$(pacman -Qq --color never | wc -l)" ;; + + *) + if type -p pkg_info >/dev/null 2>&1; then + packages="$(pkg_info | wc -l)" + elif type -p pkg >/dev/null 2>&1; then + packages="$(pkg info | wc -l)" + fi + ;; + esac ;; "Windows")