mirror of
https://github.com/alexanderepstein/Bash-Snippets
synced 2018-11-08 02:59:35 +01:00
Stylistic changes to uninstall (#95)
This commit is contained in:
parent
ac7857f2b6
commit
006f441d04
11
uninstall.sh
11
uninstall.sh
@ -5,10 +5,10 @@ all="1"
|
|||||||
|
|
||||||
askUninstall()
|
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]: "
|
echo -n "Do you wish to uninstall $1 [Y/n]: "
|
||||||
read -r answer
|
read -r answer
|
||||||
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
if [[ "$answer" == [Yy] ]]; then
|
||||||
cd $1 || return 1
|
cd $1 || return 1
|
||||||
echo -n "Removing $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; }
|
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; }
|
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[@]}"
|
for tool in "${tools[@]}"; do
|
||||||
do
|
|
||||||
askUninstall $tool || exit 1
|
askUninstall $tool || exit 1
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ $all == "1" ]];then removeManpage || exit 1;fi
|
if [[ $all == "1" ]]; then
|
||||||
|
removeManpage || exit 1
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user