install.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ZSH=`/usr/bin/env|grep 'ZSH='|cut -d '=' -f 2`
  2. if [ -d "$ZSH" ]
  3. then
  4. echo "\033[0;33mYou already have Oh My Zsh installed.\033[0m You'll need to remove $ZSH if you want to install"
  5. exit
  6. elif [ -d ~/.oh-my-zsh ]
  7. then
  8. echo "\033[0;33mYou already have One Oh My Zsh Directory.\033[0m You'll need to remove ~/.oh-my-zsh if you want to clone"
  9. exit
  10. fi
  11. echo "\033[0;34mCloning Oh My Zsh...\033[0m"
  12. hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh || {
  13. echo "git not installed"
  14. exit
  15. }
  16. echo "\033[0;34mLooking for an existing zsh config...\033[0m"
  17. if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]
  18. then
  19. echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32mBacking up to ~/.zshrc.pre-oh-my-zsh\033[0m";
  20. mv ~/.zshrc ~/.zshrc.pre-oh-my-zsh;
  21. fi
  22. echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m"
  23. cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
  24. echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m"
  25. echo "export PATH=\$PATH:$PATH" >> ~/.zshrc
  26. echo "\033[0;34mTime to change your default shell to zsh!\033[0m"
  27. chsh -s `which zsh`
  28. echo "\033[0;32m"' __ __ '"\033[0m"
  29. echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m"
  30. echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m"
  31. echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m"
  32. echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m"
  33. echo "\033[0;32m"' /____/ '"\033[0m"
  34. echo "\n\n \033[0;32m....is now installed.\033[0m"
  35. /usr/bin/env zsh
  36. source ~/.zshrc