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