uninstall.sh 673 B

12345678910111213141516171819202122232425262728
  1. echo "Removing ~/.oh-my-zsh"
  2. if [[ -d ~/.oh-my-zsh ]]
  3. then
  4. rm -rf ~/.oh-my-zsh
  5. fi
  6. echo "Looking for original zsh config..."
  7. if [ -f ~/.zshrc.pre-oh-my-zsh ] || [ -h ~/.zshrc.pre-oh-my-zsh ]
  8. then
  9. echo "Found ~/.zshrc.pre-oh-my-zsh -- Restoring to ~/.zshrc";
  10. if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]
  11. then
  12. ZSHRC_SAVE=".zshrc.omz-uninstalled-`date +%Y%m%d%H%M%S`";
  13. echo "Found ~/.zshrc -- Renaming to ~/${ZSHRC_SAVE}";
  14. mv ~/.zshrc ~/${ZSHRC_SAVE};
  15. fi
  16. mv ~/.zshrc.pre-oh-my-zsh ~/.zshrc;
  17. source ~/.zshrc;
  18. else
  19. echo "Switching back to bash"
  20. chsh -s /bin/bash
  21. source /etc/profile
  22. fi
  23. echo "Thanks for trying out Oh My Zsh. It's been uninstalled."