Commit 709000757925b396adf499b2612212140407f261
1 parent
fa903b650f
Exists in
master
and in
2 other branches
IMP tools/install.sh
Showing 1 changed file with 1 additions and 1 deletions Inline Diff
tools/install.sh
| 1 | set -e | 1 | set -e |
| 2 | 2 | ||
| 3 | if [ ! -n "$ZCNF" ]; then | 3 | if [ ! -n "$ZCNF" ]; then |
| 4 | ZCNF=~/.config/zsh-config | 4 | ZCNF=~/.config/zsh-config |
| 5 | fi | 5 | fi |
| 6 | 6 | ||
| 7 | if [ ! -n "$ZSH" ]; then | 7 | if [ ! -n "$ZSH" ]; then |
| 8 | ZSH=~/.config/zsh-config/tools/oh-my-zsh | 8 | ZSH=~/.config/zsh-config/tools/oh-my-zsh |
| 9 | fi | 9 | fi |
| 10 | 10 | ||
| 11 | echo "\033[0;34mCloning Zsh Config...\033[0m" | 11 | echo "\033[0;34mCloning Zsh Config...\033[0m" |
| 12 | hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || { | 12 | hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || { |
| 13 | echo "can't clone repo.. trying to pull" | 13 | echo "can't clone repo.. trying to pull" |
| 14 | hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || { | 14 | hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || { |
| 15 | echo "can't pull, either.. giving up.." | 15 | echo "can't pull, either.. giving up.." |
| 16 | } | 16 | } |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | echo "\033[0;34mLooking for an existing zsh config...\033[0m" | 19 | echo "\033[0;34mLooking for an existing zsh config...\033[0m" |
| 20 | if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then | 20 | if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then |
| 21 | echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32mBacking up to ~/.zshrc.pre-zsh-cnf\033[0m"; | 21 | echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32mBacking up to ~/.zshrc.pre-zsh-cnf\033[0m"; |
| 22 | mv ~/.zshrc ~/.zshrc.pre-zsh-cnf; | 22 | mv ~/.zshrc ~/.zshrc.pre-zsh-cnf; |
| 23 | fi | 23 | fi |
| 24 | 24 | ||
| 25 | echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m" | 25 | echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m" |
| 26 | cp $ZCNF/templates/zshrc ~/.zshrc | 26 | ln -s $ZCNF/templates/zshrc ~/.zshrc |
| 27 | ln -s $ZCNF/templates/bash_aliases ~/.bash_aliases | 27 | ln -s $ZCNF/templates/bash_aliases ~/.bash_aliases |
| 28 | sed -i -e "/^export ZSH=/ c\\ | 28 | sed -i -e "/^export ZSH=/ c\\ |
| 29 | export ZSH=$ZSH | 29 | export ZSH=$ZSH |
| 30 | " ~/.zshrc | 30 | " ~/.zshrc |
| 31 | 31 | ||
| 32 | echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" | 32 | echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" |
| 33 | sed -i -e "/export PATH=/ c\\ | 33 | sed -i -e "/export PATH=/ c\\ |
| 34 | export PATH=\"$PATH\" | 34 | export PATH=\"$PATH\" |
| 35 | " ~/.zshrc | 35 | " ~/.zshrc |
| 36 | 36 | ||
| 37 | if [ "$SHELL" != "$(which zsh)" ]; then | 37 | if [ "$SHELL" != "$(which zsh)" ]; then |
| 38 | echo "\033[0;34mTime to change your default shell to zsh!\033[0m" | 38 | echo "\033[0;34mTime to change your default shell to zsh!\033[0m" |
| 39 | chsh -s `which zsh` | 39 | chsh -s `which zsh` |
| 40 | fi | 40 | fi |
| 41 | 41 | ||
| 42 | echo "\033[0;32m"' __ __ '"\033[0m" | 42 | echo "\033[0;32m"' __ __ '"\033[0m" |
| 43 | echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" | 43 | echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" |
| 44 | echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" | 44 | echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" |
| 45 | echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" | 45 | echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" |
| 46 | echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" | 46 | echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" |
| 47 | echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" | 47 | echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" |
| 48 | echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" | 48 | echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" |
| 49 | echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" | 49 | echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" |
| 50 | echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m" | 50 | echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m" |
| 51 | env zsh | 51 | env zsh |
| 52 | . ~/.zshrc | 52 | . ~/.zshrc |
| 53 | 53 | ||
| 54 | 54 | ||
| 55 | 55 |