Skip to content

Instantly share code, notes, and snippets.

@bodiam
Created October 24, 2013 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bodiam/7146830 to your computer and use it in GitHub Desktop.
Save bodiam/7146830 to your computer and use it in GitHub Desktop.
Uninstall GVM
#!/bin/bash
if [ ! -d ~/.gvm ]; then
echo "No .gvm directory found in home directory. Are you sure GVM is installed?"
exit 1
fi
rm -rf ~/.gvm
for file in '.bashrc' '.bash_profile' '.zshrc'
do
date=$(date +"%m-%d-%Y")
tmp_file=$file.gvm-tmp_$date
cp $file $file.gvm-backup_$date
sed -e '/#THIS MUST BE AT THE END.*/,/.*gvm-init.sh/ d' $file > $tmp_file
mv $tmp_file $file
done
echo "GVM successfully uninstalled."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment