install.sh 837 B

1234567891011121314151617181920212223242526272829
  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. fi
  6. echo "Cloning Oh My Zsh..."
  7. /usr/bin/env git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
  8. echo "Looking for an existing zsh config..."
  9. if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]
  10. then
  11. echo "Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh";
  12. cp ~/.zshrc ~/.zshrc.pre-oh-my-zsh;
  13. rm ~/.zshrc;
  14. fi
  15. echo "Using the Oh My Zsh template file and adding it to ~/.zshrc"
  16. cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
  17. echo "Copying your current PATH and adding it to the end of ~/.zshrc for you."
  18. echo "export PATH=$PATH" >> ~/.zshrc
  19. echo "Time to change your default shell to zsh!"
  20. chsh -s /bin/zsh
  21. echo "Hooray! Oh My Zsh has been installed."
  22. /bin/zsh
  23. source ~/.zshrc