uninstall.sh 781 B

1234567891011121314151617181920212223242526272829303132
  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. if hash chsh >/dev/null 2>&1
  20. then
  21. echo "Switching back to bash"
  22. chsh -s /bin/bash
  23. else
  24. echo "You can edit /etc/passwd to switch your default shell back to bash"
  25. fi
  26. fi
  27. echo "Thanks for trying out Oh My Zsh. It's been uninstalled."