Commit da5bd4cbf8731e5ec585e67aeded176ea06cdbe6
1 parent
0256da3376
Exists in
master
and in
2 other branches
install.sh: clear symlinks, too
Showing 1 changed file with 4 additions and 4 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/zsh-config ]; then | 16 | if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then |
17 | if [ -d ~/.config/zsh-config ]; then | 17 | if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then |
18 | rm -rf ~/.config/zsh-config | 18 | rm -rf ~/.config/zsh-config |
19 | fi | 19 | fi |
20 | if [ -d ~/.config/oh-my-zsh ]; then | 20 | if [ -d ~/.config/oh-my-zsh ] || [ -h ~/.config/oh-my-zsh ]; then |
21 | rm -rf ~/.config/oh-my-zsh | 21 | rm -rf ~/.config/oh-my-zsh |
22 | fi | 22 | fi |
23 | if [ -d ~/.config/antigen ]; then | 23 | if [ -d ~/.config/antigen ] || [ -h ~/.config/antigen ]; then |
24 | rm -rf ~/.config/antigen | 24 | rm -rf ~/.config/antigen |
25 | fi | 25 | fi |
26 | if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then | 26 | if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then |
27 | mv ~/.zshrc ~/.zshrc.pre-zsh-cnf | 27 | mv ~/.zshrc ~/.zshrc.pre-zsh-cnf |
28 | fi | 28 | fi |
29 | 29 | ||
30 | # | 30 | # |
31 | # BASH: | 31 | # BASH: |
32 | # | 32 | # |
33 | 33 | ||
34 | if [ -f ~/.bashrc ] || [ -h ~/.bashrc ]; then | 34 | if [ -f ~/.bashrc ] || [ -h ~/.bashrc ]; then |
35 | mv ~/.bashrc ~/.bashrc.pre-zsh-cnf | 35 | mv ~/.bashrc ~/.bashrc.pre-zsh-cnf |
36 | fi | 36 | fi |
37 | if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then | 37 | if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then |
38 | rm ~/.bash_aliases | 38 | rm ~/.bash_aliases |
39 | fi | 39 | fi |
40 | fi | 40 | fi |
41 | 41 | ||
42 | echo "\033[0;34mCloning Zsh Config...\033[0m" | 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 || { | 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.." | 44 | echo "can't clone repo.." |
45 | exit 1 | 45 | exit 1 |
46 | } | 46 | } |
47 | 47 | ||
48 | 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" |
49 | ln -s $ZCNF/templates/zshrc ~/.zshrc | 49 | ln -s $ZCNF/templates/zshrc ~/.zshrc |
50 | ln -s $ZCNF/templates/bashrc ~/.bashrc | 50 | ln -s $ZCNF/templates/bashrc ~/.bashrc |
51 | ln -s $ZCNF/templates/bash_aliases ~/.bash_aliases | 51 | ln -s $ZCNF/templates/bash_aliases ~/.bash_aliases |
52 | sed -i -e "/^export ZSH=/ c\\ | 52 | sed -i -e "/^export ZSH=/ c\\ |
53 | export ZSH=$ZSH | 53 | export ZSH=$ZSH |
54 | " ~/.zshrc | 54 | " ~/.zshrc |
55 | 55 | ||
56 | 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" |
57 | sed -i -e "/export PATH=/ c\\ | 57 | sed -i -e "/export PATH=/ c\\ |
58 | export PATH=\"$PATH\" | 58 | export PATH=\"$PATH\" |
59 | " ~/.zshrc | 59 | " ~/.zshrc |
60 | 60 | ||
61 | if [ "$SHELL" != "$(which zsh)" ]; then | 61 | if [ "$SHELL" != "$(which zsh)" ]; then |
62 | 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" |
63 | # chsh -s `which zsh` | 63 | # chsh -s `which zsh` |
64 | fi | 64 | fi |
65 | 65 | ||
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"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" |
71 | echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" | 71 | echo "\033[0;32m"' /____/ ....is now installed!'"\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;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\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.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" |
74 | 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" |
75 | env zsh | 75 | env zsh |
76 | . ~/.zshrc | 76 | . ~/.zshrc |
77 | 77 |