diff --git a/uninstall.sh b/uninstall.sh index b6a0862..29fb260 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -5,10 +5,10 @@ all="1" askUninstall() { - if [[ -f /usr/local/bin/$1 ]];then + if [[ -f /usr/local/bin/$1 ]]; then echo -n "Do you wish to uninstall $1 [Y/n]: " read -r answer - if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then + if [[ "$answer" == [Yy] ]]; then cd $1 || return 1 echo -n "Removing $1: " rm -f /usr/local/bin/$1 > /dev/null 2>&1 || { echo "Failed" ; echo "Error removing file, try running uninstall script as sudo"; exit 1; } @@ -26,9 +26,10 @@ removeManpage() rm -f /usr/local/man/man1/bash-snippets.1 2>&1 || { echo "Failed" ; echo "Error removing file, try running uninstall script as sudo"; exit 1; } } -for tool in "${tools[@]}" -do +for tool in "${tools[@]}"; do askUninstall $tool || exit 1 done -if [[ $all == "1" ]];then removeManpage || exit 1;fi +if [[ $all == "1" ]]; then + removeManpage || exit 1 +fi