install.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 https://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. if [ -f /bin/zsh ]
  21. then
  22. chsh -s /bin/zsh
  23. else
  24. chsh -s "/usr/bin/env zsh"
  25. fi
  26. echo ' __ __ '
  27. echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ '
  28. echo ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '
  29. echo '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '
  30. echo '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '
  31. echo ' /____/'
  32. echo "\n\n ....is now installed."
  33. /usr/bin/env zsh
  34. source ~/.zshrc