From c78925c974313b34b34a1696b927d7b913166ae0 Mon Sep 17 00:00:00 2001 From: victor Date: Thu, 31 Dec 2020 00:35:49 +0330 Subject: [PATCH] check package installed function bug fixed --- scripts/sharedFuncs.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/sharedFuncs.sh b/scripts/sharedFuncs.sh index f6eb102..afc4b8f 100755 --- a/scripts/sharedFuncs.sh +++ b/scripts/sharedFuncs.sh @@ -1,7 +1,8 @@ function package_installed() { - local which=$(which $1 2>/dev/null) - if [ "$which" == "/usr/bin/$1" ];then + which $1 &> /dev/null + local pkginstalled="$?" + if [ "$pkginstalled" -eq 0 ];then show_message "package\033[1;36m $1\e[0m is installed..." else warning "package\033[1;33m $1\e[0m is not installed.\nplease make sure it's already installed"