mirror of https://github.com/mjohanning99/RubyTLDR
Add option to remove existing RubyTldr installation in installer
parent
05a53070d5
commit
ef2aae606d
13
installer.sh
13
installer.sh
|
@ -11,6 +11,18 @@ ruby_version=$(ruby -v)
|
|||
|
||||
if [[ $ruby_version == *ruby* ]]; then printf "A Ruby installation ($ruby_version) has been found on your machine. Proceeding ... \n\n"; else "No Ruby installation could be found on your machine. Please download the latest version of Ruby using your distribution's package manager or by compiling it from source"; exit; fi
|
||||
|
||||
if [ -e ~/.rtldr ]
|
||||
then
|
||||
echo "The program seems to have already been installed previously, since the ~/.rtldr folder already exists. Do you wish to remove the folder and replace the old RubyTldr version with the one you have just downloaded?"
|
||||
|
||||
select yn in "Yes" "No"; do
|
||||
case $yn in
|
||||
Yes ) echo "Removing old ~./rtldr... " ; rm -r --interactive=never ~/.rtldr ; break;;
|
||||
No ) echo "The symbolic link will not be removed. Please be aware that this may break your rtldr installation. Setting a symlink manually, instead, and potentially altering a few of the files will now be necessary."; break;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -e ~/.rtldr ]; then echo "The program seems to have already been installed since the ~/.rtldr directory already exists. In that case, please use the command 'updatetldr'" && exit; else echo "Installation starting."; fi
|
||||
|
||||
if [[ -e tldr && -e lib/bin/tldr.rb ]]
|
||||
|
@ -83,4 +95,3 @@ echo "Removing installer ..."
|
|||
sudo rm installer.sh
|
||||
|
||||
echo "If you see this message, everything should've been installed correctly. To ensure that it has, please run 'rtldr tldr'. If you get an explanation of this program, then everything worked correctly."
|
||||
#echo "To update tldr, please run updatetldr"
|
||||
|
|
Loading…
Reference in New Issue