Fix checking if package is installed

This commit is contained in:
Filip Litwora 2020-10-04 17:31:53 +02:00
parent 8440b2b220
commit a1e38b20b3
1 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
function package_installed(){ function package_installed(){
local which=$(which $1 2>/dev/null) which $1 &> /dev/null
if [ "$which" == "/usr/bin/$1" ];then local status=$?
if [ $status -eq 0 ];then
show_message "package\033[1;36m $1\e[0m is installed..." show_message "package\033[1;36m $1\e[0m is installed..."
else else
warning "package\033[1;33m $1\e[0m is not installed.\nplease make sure it's already installed" warning "package\033[1;33m $1\e[0m is not installed.\nplease make sure it's already installed"