install.sh 846 B

123456789101112131415161718192021222324252627282930
  1. if [ -d ~/.oh-my-zsh ]
  2. then
  3. echo "You already have Oh My Zsh installed. You'll need to remove ~/.oh-my-zsh if you want to install"
  4. exit
  5. else
  6. echo "Cloning Oh My Zsh..."
  7. /usr/bin/env git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
  8. fi
  9. echo "Looking for an existing zsh config..."
  10. if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]
  11. then
  12. echo "Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh";
  13. cp ~/.zshrc ~/.zshrc.pre-oh-my-zsh;
  14. rm ~/.zshrc;
  15. fi
  16. echo "Using the Oh My Zsh template file and adding it to ~/.zshrc"
  17. cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
  18. echo "Copying your current PATH and adding it to the end of ~/.zshrc for you."
  19. echo "export PATH=$PATH" >> ~/.zshrc
  20. echo "Time to change your default shell to zsh!"
  21. chsh -s /bin/zsh
  22. echo "Hooray! Oh My Zsh has been installed."
  23. /bin/zsh
  24. source ~/.zshrc