Commit 0256da3376cf7714ad1c670f3c329d3912e94905
1 parent
fb9feed374
Exists in
master
and in
2 other branches
FIXES
Showing 1 changed file with 6 additions and 5 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;34mCloning Zsh Config...\033[0m" | ||
| 16 | hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || { | ||
| 17 | echo "can't clone repo.." | ||
| 18 | } | ||
| 19 | |||
| 20 | echo "\033[0;34mCleaning...\033[0m" | 15 | echo "\033[0;34mCleaning...\033[0m" |
| 21 | if [ -d ~/.config/zsh-config ]; then | 16 | if [ -d ~/.config/zsh-config ]; then |
| 22 | if [ -d ~/.config/zsh-config ]; then | 17 | if [ -d ~/.config/zsh-config ]; then |
| 23 | rm -rf ~/.config/zsh-config | 18 | rm -rf ~/.config/zsh-config |
| 24 | fi | 19 | fi |
| 25 | if [ -d ~/.config/oh-my-zsh ]; then | 20 | if [ -d ~/.config/oh-my-zsh ]; then |
| 26 | rm -rf ~/.config/oh-my-zsh | 21 | rm -rf ~/.config/oh-my-zsh |
| 27 | fi | 22 | fi |
| 28 | if [ -d ~/.config/antigen ]; then | 23 | if [ -d ~/.config/antigen ]; then |
| 29 | rm -rf ~/.config/antigen | 24 | rm -rf ~/.config/antigen |
| 30 | fi | 25 | fi |
| 31 | if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then | 26 | if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then |
| 32 | mv ~/.zshrc ~/.zshrc.pre-zsh-cnf | 27 | mv ~/.zshrc ~/.zshrc.pre-zsh-cnf |
| 33 | fi | 28 | fi |
| 34 | 29 | ||
| 35 | # | 30 | # |
| 36 | # BASH: | 31 | # BASH: |
| 37 | # | 32 | # |
| 38 | 33 | ||
| 39 | if [ -f ~/.bashrc ] || [ -h ~/.bashrc ]; then | 34 | if [ -f ~/.bashrc ] || [ -h ~/.bashrc ]; then |
| 40 | mv ~/.bashrc ~/.bashrc.pre-zsh-cnf | 35 | mv ~/.bashrc ~/.bashrc.pre-zsh-cnf |
| 41 | fi | 36 | fi |
| 42 | if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then | 37 | if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then |
| 43 | rm ~/.bash_aliases | 38 | rm ~/.bash_aliases |
| 44 | fi | 39 | fi |
| 45 | fi | 40 | fi |
| 46 | 41 | ||
| 42 | echo "\033[0;34mCloning Zsh Config...\033[0m" | ||
| 43 | hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || { | ||
| 44 | echo "can't clone repo.." | ||
| 45 | exit 1 | ||
| 46 | } | ||
| 47 | |||
| 47 | echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m" | 48 | echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m" |
| 48 | ln -s $ZCNF/templates/zshrc ~/.zshrc | 49 | ln -s $ZCNF/templates/zshrc ~/.zshrc |
| 49 | ln -s $ZCNF/templates/bashrc ~/.bashrc | 50 | ln -s $ZCNF/templates/bashrc ~/.bashrc |
| 50 | ln -s $ZCNF/templates/bash_aliases ~/.bash_aliases | 51 | ln -s $ZCNF/templates/bash_aliases ~/.bash_aliases |
| 51 | sed -i -e "/^export ZSH=/ c\\ | 52 | sed -i -e "/^export ZSH=/ c\\ |
| 52 | export ZSH=$ZSH | 53 | export ZSH=$ZSH |
| 53 | " ~/.zshrc | 54 | " ~/.zshrc |
| 54 | 55 | ||
| 55 | echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" | 56 | echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" |
| 56 | sed -i -e "/export PATH=/ c\\ | 57 | sed -i -e "/export PATH=/ c\\ |
| 57 | export PATH=\"$PATH\" | 58 | export PATH=\"$PATH\" |
| 58 | " ~/.zshrc | 59 | " ~/.zshrc |
| 59 | 60 | ||
| 60 | if [ "$SHELL" != "$(which zsh)" ]; then | 61 | if [ "$SHELL" != "$(which zsh)" ]; then |
| 61 | echo "\033[0;34mTime to change your default shell to zsh!\033[0m" | 62 | echo "\033[0;34mTime to change your default shell to zsh!\033[0m" |
| 62 | # chsh -s `which zsh` | 63 | # chsh -s `which zsh` |
| 63 | fi | 64 | fi |
| 64 | 65 | ||
| 65 | echo "\033[0;32m"' __ __ '"\033[0m" | 66 | echo "\033[0;32m"' __ __ '"\033[0m" |
| 66 | echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" | 67 | echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" |
| 67 | echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" | 68 | echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" |
| 68 | echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" | 69 | echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" |
| 69 | echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" | 70 | echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" |
| 70 | echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" | 71 | echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" |
| 71 | echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" | 72 | echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" |