mirror of
https://github.com/G2-Games/welcome.sh.git
synced 2025-04-19 05:22:53 -05:00
Fixed line removal for uninstall
This commit is contained in:
parent
fd252ec80e
commit
05d3f673b0
1 changed files with 8 additions and 6 deletions
14
install.sh
14
install.sh
|
@ -1,6 +1,4 @@
|
||||||
#!/bin/zsh
|
version=0.2
|
||||||
|
|
||||||
version='0.2'
|
|
||||||
bashrc="/home/$USER/.bashrc"
|
bashrc="/home/$USER/.bashrc"
|
||||||
zshrc="/home/$USER/.zshrc"
|
zshrc="/home/$USER/.zshrc"
|
||||||
originaldir=$PWD
|
originaldir=$PWD
|
||||||
|
@ -43,8 +41,12 @@ then
|
||||||
then
|
then
|
||||||
rm /home/$USER/.welcome/welcome.sh
|
rm /home/$USER/.welcome/welcome.sh
|
||||||
rmdir /home/$USER/.welcome
|
rmdir /home/$USER/.welcome
|
||||||
sed -i 's#bash /home/$USER/.welcome/welcome.sh##g' $bashrc # Try from both
|
line=$(grep -n 'bash /home/$USER/.welcome/welcome.sh' $bashrc)
|
||||||
sed -i 's#zsh /home/$USER/.welcome/welcome.sh##g' $zshrc
|
line=${line%:*}
|
||||||
|
sed -i "${line}d" $bashrc
|
||||||
|
line=$(grep -n 'zsh /home/$USER/.welcome/welcome.sh' $zshrc)
|
||||||
|
line=${line%:*}
|
||||||
|
sed -i "${line}d" $zshrc
|
||||||
tput rc el ed
|
tput rc el ed
|
||||||
echo -e "\e[36mUninstalled! \e[0m"
|
echo -e "\e[36mUninstalled! \e[0m"
|
||||||
else
|
else
|
||||||
|
@ -53,5 +55,5 @@ then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "This script can only be installed in bash or zsh."
|
printf "\e[31;5mERROR:\e[0m \e[31;3mThis script can only be installed in bash or zsh.\e[0m\n"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue