Commit e7092986d670fce7ab33d0af4508a72c9024ae02

Authored by mj
1 parent 9f172c7202
Exists in master and in 2 other branches 02-merge, dev

install.sh

Showing 1 changed file with 20 additions and 1 deletions Inline Diff

1 #@IgnoreInspection AddShebang 1 #@IgnoreInspection AddShebang
2 # ** Initiate with: ** 2 # ** Initiate with: **
3 # 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
4 # ----------------------------------------------------------------------------------- 4 # -----------------------------------------------------------------------------------
5 5
6 set -e 6 set -e
7 7
8 if [ "$SHELL" != "$(which zsh)" ]; then
9 echo "$(which zsh)"
10 sudo echo "enter pass...."
11
12 echo "ok"
13
14 sudo apt-get -yq install curl dialog nano python-setuptools zsh
15
16 sudo easy_install pip
17 sudo pip install virutalenvwrapper
18 fi
19
20 if [ 1 == 1 ]; then
21 mkvirtualenv cb-meteor
22 pip install nodeenv
23 nodeenv -p
24 curl https://install.meteor.com/ | sh
25 fi
26
8 if [ ! -n "$ZCNF" ]; then 27 if [ ! -n "$ZCNF" ]; then
9 ZCNF=~/.config/zsh-config 28 ZCNF=~/.config/zsh-config
10 fi 29 fi
11 30
12 if [ ! -n "$ZSH" ]; then 31 if [ ! -n "$ZSH" ]; then
13 ZSH=$ZCNF/tools/oh-my-zsh 32 ZSH=$ZCNF/tools/oh-my-zsh
14 fi 33 fi
15 34
16 echo "\033[0;34mCleaning...\033[0m" 35 echo "\033[0;34mCleaning...\033[0m"
17 if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then 36 if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then
18 if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then 37 if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then
19 rm -rf ~/.config/zsh-config 38 rm -rf ~/.config/zsh-config
20 fi 39 fi
21 if [ -d ~/.config/oh-my-zsh ] || [ -h ~/.config/oh-my-zsh ]; then 40 if [ -d ~/.config/oh-my-zsh ] || [ -h ~/.config/oh-my-zsh ]; then
22 rm -rf ~/.config/oh-my-zsh 41 rm -rf ~/.config/oh-my-zsh
23 fi 42 fi
24 if [ -d ~/.config/antigen ] || [ -h ~/.config/antigen ]; then 43 if [ -d ~/.config/antigen ] || [ -h ~/.config/antigen ]; then
25 rm -rf ~/.config/antigen 44 rm -rf ~/.config/antigen
26 fi 45 fi
27 fi 46 fi
28 47
29 if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then 48 if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then
30 mv ~/.zshrc ~/.zshrc.pre-zsh-cnf 49 mv ~/.zshrc ~/.zshrc.pre-zsh-cnf
31 fi 50 fi
32 # 51 #
33 # BASH: 52 # BASH:
34 # 53 #
35 if [ -f ~/.bashrc ] || [ -h ~/.bashrc ]; then 54 if [ -f ~/.bashrc ] || [ -h ~/.bashrc ]; then
36 mv ~/.bashrc ~/.bashrc.pre-zsh-cnf 55 mv ~/.bashrc ~/.bashrc.pre-zsh-cnf
37 fi 56 fi
38 if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then 57 if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then
39 rm ~/.bash_aliases 58 rm ~/.bash_aliases
40 fi 59 fi
41 60
42 echo "\033[0;34mCloning Zsh Config...\033[0m" 61 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 || { 62 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.." 63 echo "can't clone repo.."
45 exit 1 64 exit 1
46 } 65 }
47 66
48 echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m" 67 echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m"
49 ln -s $ZCNF/templates/zshrc ~/.zshrc 68 ln -s $ZCNF/templates/zshrc ~/.zshrc
50 ln -s $ZCNF/templates/bashrc ~/.bashrc 69 ln -s $ZCNF/templates/bashrc ~/.bashrc
51 ln -s $ZCNF/templates/bash_aliases ~/.bash_aliases 70 ln -s $ZCNF/templates/bash_aliases ~/.bash_aliases
52 sed -i -e "/^export ZSH=/ c\\ 71 sed -i -e "/^export ZSH=/ c\\
53 export ZSH=$ZSH 72 export ZSH=$ZSH
54 " ~/.zshrc 73 " ~/.zshrc
55 74
56 echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" 75 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\\ 76 sed -i -e "/export PATH=/ c\\
58 export PATH=\"$PATH\" 77 export PATH=\"$PATH\"
59 " ~/.zshrc 78 " ~/.zshrc
60 79
61 if [ "$SHELL" != "$(which zsh)" ]; then 80 if [ "$SHELL" != "$(which zsh)" ]; then
62 echo "\033[0;34mTime to change your default shell to zsh!\033[0m" 81 echo "\033[0;34mTime to change your default shell to zsh!\033[0m"
63 # chsh -s `which zsh` 82 echo "chsh -s $(which zsh)"
64 fi 83 fi
65 84
66 echo "\033[0;32m"' __ __ '"\033[0m" 85 echo "\033[0;32m"' __ __ '"\033[0m"
67 echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" 86 echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m"
68 echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" 87 echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m"
69 echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" 88 echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m"
70 echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" 89 echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m"
71 echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" 90 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" 91 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" 92 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" 93 echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m"
75 env zsh 94 env zsh
76 . ~/.zshrc 95 . ~/.zshrc
77 96