Added color support in output

This commit is contained in:
Eduard Tolosa 2018-07-07 10:13:50 -05:00
parent 3843b62fb4
commit 5dc0c6b6ae
2 changed files with 8 additions and 8 deletions

View file

@ -5,19 +5,19 @@ simplesearchlocal="./simplesearch"
simplesearchglobal="/usr/bin/simplesearch"
if [ ! -f "$pacmaninstalled" ]; then
printf "\n%s\n" "You are not using ArchLinux (pacman not found in $pacmaninstalled)"
printf "\e[1;31m%-6s\e[m%s\n" "You are not using ArchLinux (pacman not found in $pacmaninstalled)"
exit
elif [ ! -f "$simplesearchlocal" ] && [ ! -f "$simplesearchglobal" ]; then
printf "\n%s\n" "simplesearch not found, make sure that you have the simplesearch script in the current folder or in /usr/bin/simplesearch"
printf "\e[1;31m%-6s\e[m%s\n" "simplesearch not found, make sure that you have the simplesearch script in the current folder or in /usr/bin/simplesearch"
exit
else
if [ -f "$simplesearchlocal" ]; then
printf "\n%s\n%s\n" "The following packages are availables for update, you can update one to one using: simpleaur package_name"
printf "\n\e[1;32m%-6s\e[m\n%s\n" "The following packages are availables for update, you can update one to one using: simpleaur package_name"
for aurpkg in $(pacman -Qmq |grep -v 'git'); do ./simplesearch "$aurpkg" |grep "installed:"; done
exit
elif [ -f "$simplesearchglobal" ]; then
printf "\n%s\n%s\n" "The following packages are availables for update, you can update one to one using: simpleaur package_name"
printf "\n\e[1;32m%-6s\e[m\n%s\n" "The following packages are availables for update, you can update one to one using: simpleaur package_name"
for aurpkg in $(pacman -Qmq |grep -v 'git'); do simplesearch "$aurpkg" |grep "installed:"; done
exit
fi

View file

@ -3,9 +3,9 @@
cowerinstalled="/usr/bin/cower"
spackage=( "$@" )
if [ ! -f "$cowerinstalled" ]; then
printf "\n%s\n" "Please, install cower first running in your terminal: gpg --recv-keys 1EB2638FF56C0C53 && simpleaur cower"
printf "\e[1;31m%-6s\e[m%s\n" "Please, install cower first running in your terminal: gpg --recv-keys 1EB2638FF56C0C53 && simpleaur cower"
else
if [ "${#spackage[@]}" -ge 0 ]; then
cower -sc "${spackage[@]}"
fi
if [ "${#spackage[@]}" -ge 0 ]; then
cower -sc "${spackage[@]}"
fi
fi