Made uninstallation work on MacOS

This commit is contained in:
G2-Games 2022-09-18 20:05:28 -05:00
parent f2f8d567db
commit 804aa8701f

View file

@ -58,12 +58,13 @@ then
line=$(grep -n 'bash ~/.welcome/welcome.sh' $bashrc) line=$(grep -n 'bash ~/.welcome/welcome.sh' $bashrc)
line=${line%:*} line=${line%:*}
sed -i "${line}d" $bashrc sed -i "${line}d" $bashrc
sed "${line}d" $bashrc > file.tmp && mv file.tmp $bashrc
fi fi
if grep -n 'zsh ~/.welcome/welcome.sh' $zshrc ; if grep -n 'zsh ~/.welcome/welcome.sh' $zshrc ;
then then
line=$(grep -n 'zsh ~/.welcome/welcome.sh' $zshrc) line=$(grep -n 'zsh ~/.welcome/welcome.sh' $zshrc)
line=${line%:*} line=${line%:*}
sed -i "${line}d" $zshrc sed "${line}d" $zshrc > file.tmp && mv file.tmp $zshrc
fi fi
# Check for older versions # # Check for older versions #
@ -71,13 +72,13 @@ then
then then
line=$(grep -n 'bash /home/$USER/.welcome/welcome.sh' $bashrc) line=$(grep -n 'bash /home/$USER/.welcome/welcome.sh' $bashrc)
line=${line%:*} line=${line%:*}
sed -i "${line}d" $bashrc sed "${line}d" $bashrc > file.tmp && mv file.tmp $bashrc
fi fi
if grep -n 'zsh /home/$USER/.welcome/welcome.sh' $zshrc ; if grep -n 'zsh /home/$USER/.welcome/welcome.sh' $zshrc ;
then then
line=$(grep -n 'zsh /home/$USER/.welcome/welcome.sh' $zshrc) line=$(grep -n 'zsh /home/$USER/.welcome/welcome.sh' $zshrc)
line=${line%:*} line=${line%:*}
sed -i "${line}d" $zshrc sed "${line}d" $zshrc > file.tmp && mv file.tmp $zshrc
fi fi
# End older version check # # End older version check #