Commit 7a903f78e6f014fbe2461eba27eadd3651a228a7
1 parent
187882c87b
Exists in
master
and in
2 other branches
JetBrains WebStorm config line
Showing 1 changed file with 1 additions and 0 deletions Inline Diff
tools/install.sh
| 1 | #@IgnoreInspection AddShebang | ||
| 1 | # ** Initiate with: ** | 2 | # ** Initiate with: ** |
| 2 | # cd && wget http://git.str8.biz/mj/zsh-config/raw/master/tools/install.sh -O -| sh | 3 | # cd && wget http://git.str8.biz/mj/zsh-config/raw/master/tools/install.sh -O -| sh |
| 3 | # ----------------------------------------------------------------------------------- | 4 | # ----------------------------------------------------------------------------------- |
| 4 | 5 | ||
| 5 | set -e | 6 | set -e |
| 6 | 7 | ||
| 7 | if [ ! -n "$ZCNF" ]; then | 8 | if [ ! -n "$ZCNF" ]; then |
| 8 | ZCNF=~/.config/zsh-config | 9 | ZCNF=~/.config/zsh-config |
| 9 | fi | 10 | fi |
| 10 | 11 | ||
| 11 | if [ ! -n "$ZSH" ]; then | 12 | if [ ! -n "$ZSH" ]; then |
| 12 | ZSH=$ZCNF/tools/oh-my-zsh | 13 | ZSH=$ZCNF/tools/oh-my-zsh |
| 13 | fi | 14 | fi |
| 14 | 15 | ||
| 15 | echo "\033[0;34mCleaning...\033[0m" | 16 | echo "\033[0;34mCleaning...\033[0m" |
| 16 | if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then | 17 | if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then |
| 17 | if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then | 18 | if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then |
| 18 | rm -rf ~/.config/zsh-config | 19 | rm -rf ~/.config/zsh-config |
| 19 | fi | 20 | fi |
| 20 | if [ -d ~/.config/oh-my-zsh ] || [ -h ~/.config/oh-my-zsh ]; then | 21 | if [ -d ~/.config/oh-my-zsh ] || [ -h ~/.config/oh-my-zsh ]; then |
| 21 | rm -rf ~/.config/oh-my-zsh | 22 | rm -rf ~/.config/oh-my-zsh |
| 22 | fi | 23 | fi |
| 23 | if [ -d ~/.config/antigen ] || [ -h ~/.config/antigen ]; then | 24 | if [ -d ~/.config/antigen ] || [ -h ~/.config/antigen ]; then |
| 24 | rm -rf ~/.config/antigen | 25 | rm -rf ~/.config/antigen |
| 25 | fi | 26 | fi |
| 26 | fi | 27 | fi |
| 27 | 28 | ||
| 28 | if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then | 29 | if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then |
| 29 | mv ~/.zshrc ~/.zshrc.pre-zsh-cnf | 30 | mv ~/.zshrc ~/.zshrc.pre-zsh-cnf |
| 30 | fi | 31 | fi |
| 31 | # | 32 | # |
| 32 | # BASH: | 33 | # BASH: |
| 33 | # | 34 | # |
| 34 | if [ -f ~/.bashrc ] || [ -h ~/.bashrc ]; then | 35 | if [ -f ~/.bashrc ] || [ -h ~/.bashrc ]; then |
| 35 | mv ~/.bashrc ~/.bashrc.pre-zsh-cnf | 36 | mv ~/.bashrc ~/.bashrc.pre-zsh-cnf |
| 36 | fi | 37 | fi |
| 37 | if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then | 38 | if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then |
| 38 | rm ~/.bash_aliases | 39 | rm ~/.bash_aliases |
| 39 | fi | 40 | fi |
| 40 | 41 | ||
| 41 | echo "\033[0;34mCloning Zsh Config...\033[0m" | 42 | echo "\033[0;34mCloning Zsh Config...\033[0m" |
| 42 | hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || { | 43 | hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || { |
| 43 | echo "can't clone repo.." | 44 | echo "can't clone repo.." |
| 44 | exit 1 | 45 | exit 1 |
| 45 | } | 46 | } |
| 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" |
| 72 | echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" | 73 | echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" |
| 73 | echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m" | 74 | echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m" |
| 74 | env zsh | 75 | env zsh |
| 75 | . ~/.zshrc | 76 | . ~/.zshrc |
| 76 | 77 |