Commit 7e0b5c1e8793ec77c3b3d4d07bb48d3ec9d9c473

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

FIX install.sh

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

1 #@IgnoreInspection AddShebang 1 #@IgnoreInspection AddShebang
2 # 2 #
3 # ** Initiate with: ** 3 # ** Initiate with: **
4 # cd && curl -L http://git.str8.biz/mj/zsh-config/raw/master/tools/install.sh | sh 4 # cd && curl -L http://git.str8.biz/mj/zsh-config/raw/master/tools/install.sh | sh
5 # 5 #
6 # --------------------------------------------------------------------------------------------- 6 # ---------------------------------------------------------------------------------------------
7 # 7 #
8 # gj@ubuntu4docker:~$ touch install.sh 8 # gj@ubuntu4docker:~$ touch install.sh
9 # gj@ubuntu4docker:~$ rm install.sh && nano install.sh && chmod +x install.sh && ./install.sh 9 # gj@ubuntu4docker:~$ rm install.sh && nano install.sh && chmod +x install.sh && ./install.sh
10 # 10 #
11 ################################################################################################ 11 ################################################################################################
12 12
13 set -e 13 set -e
14 14
15 if [ "$SHELL" != "$(which zsh)" ]; then 15 if [ "$SHELL" != "$(which zsh)" ]; then
16 echo "$(which zsh)" 16 echo "$(which zsh)"
17 sudo echo "enter pass...." 17 sudo echo "enter pass...."
18 18
19 echo "ok" 19 echo "ok"
20 20
21 sudo apt-get -yq install curl dialog git nano zsh 21 sudo apt-get -yq install curl dialog git nano zsh
22 fi 22 fi
23 23
24 if [ 1 == 2 ]; then 24 if [ 1 == 2 ]; then
25 #sudo apt-get -yq python-setuptools 25 #sudo apt-get -yq python-setuptools
26 26
27 #sudo easy_install pip 27 #sudo easy_install pip
28 #sudo pip install virtualenvwrapper 28 #sudo pip install virtualenvwrapper
29 29
30 mkvirtualenv cb-meteor 30 mkvirtualenv cb-meteor
31 pip install nodeenv 31 pip install nodeenv
32 nodeenv -p 32 nodeenv -p
33 33
34 # curl https://install.meteor.com/ | sh 34 # curl https://install.meteor.com/ | sh
35 fi 35 fi
36 36
37 if [ ! -n "$HOME" ]; then 37 if [ ! -n "$HOME" ]; then
38 HOME=~/ 38 HOME=~/
39 fi 39 fi
40 40
41 if [ ! -n "$ZCNF" ]; then 41 if [ ! -n "$ZCNF" ]; then
42 ZCNF=$HOME/.config/zsh-config 42 ZCNF=$HOME/.config/zsh-config
43 fi 43 fi
44 44
45 if [ ! -n "$ZSH" ]; then 45 if [ ! -n "$ZSH" ]; then
46 ZSH=$ZCNF/packages/oh-my-zsh 46 ZSH=$ZCNF/packages/oh-my-zsh
47 fi 47 fi
48 48
49 echo "\033[0;34mCleaning...\033[0m" 49 echo "\033[0;34mCleaning...\033[0m"
50 if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then 50 if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then
51 rm -rf ~/.config/zsh-config 51 rm -rf ~/.config/zsh-config
52 fi 52 fi
53 53
54 if [ -d ~/.config/oh-my-zsh ] || [ -h ~/.config/oh-my-zsh ]; then 54 if [ -d ~/.config/oh-my-zsh ] || [ -h ~/.config/oh-my-zsh ]; then
55 rm -rf ~/.config/oh-my-zsh 55 rm -rf ~/.config/oh-my-zsh
56 fi 56 fi
57 57
58 if [ -d ~/.config/antigen ] || [ -h ~/.config/antigen ]; then 58 if [ -d ~/.config/antigen ] || [ -h ~/.config/antigen ]; then
59 rm -rf ~/.config/antigen 59 rm -rf ~/.config/antigen
60 fi 60 fi
61 61
62 if [ -d ~/.oh-my-zsh ] || [ -h ~/.oh-my-zsh ]; then 62 if [ -d ~/.oh-my-zsh ] || [ -h ~/.oh-my-zsh ]; then
63 rm -rf ~/.oh-my-zsh 63 rm -rf ~/.oh-my-zsh
64 fi 64 fi
65 65
66 if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then 66 if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then
67 mv ~/.zshrc ~/.zshrc.pre-zsh-cnf 67 mv ~/.zshrc ~/.zshrc.pre-zsh-cnf
68 fi 68 fi
69 69
70 # 70 #
71 # BASH: 71 # BASH:
72 # 72 #
73 if [ -f ~/.bashrc ] || [ -h ~/.bashrc ]; then 73 if [ -f ~/.bashrc ] || [ -h ~/.bashrc ]; then
74 mv ~/.bashrc ~/.bashrc.pre-zsh-cnf 74 mv ~/.bashrc ~/.bashrc.pre-zsh-cnf
75 fi 75 fi
76 if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then 76 if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then
77 rm ~/.bash_aliases 77 rm ~/.bash_aliases
78 fi 78 fi
79 79
80 echo "\033[0;34mCloning Zsh Config...\033[0m" 80 echo "\033[0;34mCloning Zsh Config...\033[0m"
81 hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || { 81 hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || {
82 echo "can't clone repo.." 82 echo "can't clone repo.."
83 exit 1 83 exit 1
84 } 84 }
85 85
86 echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m" 86 echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m"
87 cp $ZCNF/templates/zshrc.sh ~/.zshrc 87 cp $ZCNF/templates/zshrc.sh ~/.zshrc
88 cp $ZCNF/templates/bashrc.sh ~/.bashrc 88 cp $ZCNF/templates/bashrc.sh ~/.bashrc
89 # ln -s $ZCNF/templates/bash_aliases.sh ~/.bash_aliases 89
90 sed -i -e "/^export ZSH=/ c\\ 90 #sed -i -e "/^export ZSH=/ c\\
91 export ZSH=$ZSH 91 #export ZSH=$ZSH
92 " ~/.zshrc 92 #" ~/.zshrc
93 93
94 echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" 94 echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m"
95 sed -i -e "/export PATH=/ c\\ 95 sed -i -e "/export PATH=/ c\\
96 export PATH=\"$PATH\" 96 export PATH=\"$PATH\"
97 " ~/.zshrc 97 " ~/.zshrc
98 98
99 if [ "$SHELL" != "$(which zsh)" ]; then 99 if [ "$SHELL" != "$(which zsh)" ]; then
100 echo "\033[0;34mTime to change your default shell to zsh!\033[0m" 100 echo "\033[0;34mTime to change your default shell to zsh!\033[0m"
101 # echo "chsh -s $(which zsh)" 101 # echo "chsh -s $(which zsh)"
102 echo "chsh -s /bin/zsh" 102 echo "chsh -s /bin/zsh"
103 fi 103 fi
104 104
105 echo "\033[0;32m"' __ __ '"\033[0m" 105 echo "\033[0;32m"' __ __ '"\033[0m"
106 echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" 106 echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m"
107 echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" 107 echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m"
108 echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" 108 echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m"
109 echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" 109 echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m"
110 echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" 110 echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m"
111 echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" 111 echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m"
112 echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" 112 echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m"
113 echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m" 113 echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m"
114 #env zsh 114 #env zsh
115 #. ~/.zshrc 115 #. ~/.zshrc
116 116