Commit 79c62734ff0a5a68baea51f8fb2680e5890ac831
1 parent
c12c31621b
Exists in
master
and in
2 other branches
install.sh - rm dirs
Showing 1 changed file with 14 additions and 9 deletions Inline Diff
tools/install.sh
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 "$ZCNF" ]; then | 37 | if [ ! -n "$ZCNF" ]; then |
38 | ZCNF=~/.config/zsh-config | 38 | ZCNF=~/.config/zsh-config |
39 | fi | 39 | fi |
40 | 40 | ||
41 | if [ ! -n "$ZSH" ]; then | 41 | if [ ! -n "$ZSH" ]; then |
42 | ZSH=$ZCNF/packages/oh-my-zsh | 42 | ZSH=$ZCNF/packages/oh-my-zsh |
43 | fi | 43 | fi |
44 | 44 | ||
45 | echo "\033[0;34mCleaning...\033[0m" | 45 | echo "\033[0;34mCleaning...\033[0m" |
46 | if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then | 46 | if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then |
47 | if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then | 47 | rm -rf ~/.config/zsh-config |
48 | rm -rf ~/.config/zsh-config | 48 | fi |
49 | fi | 49 | |
50 | # if [ -d ~/.config/oh-my-zsh ] || [ -h ~/.config/oh-my-zsh ]; then | 50 | if [ -d ~/.config/oh-my-zsh ] || [ -h ~/.config/oh-my-zsh ]; then |
51 | # rm -rf ~/.config/oh-my-zsh | 51 | rm -rf ~/.config/oh-my-zsh |
52 | # fi | 52 | fi |
53 | if [ -d ~/.config/antigen ] || [ -h ~/.config/antigen ]; then | 53 | |
54 | rm -rf ~/.config/antigen | 54 | if [ -d ~/.config/antigen ] || [ -h ~/.config/antigen ]; then |
55 | fi | 55 | rm -rf ~/.config/antigen |
56 | fi | ||
57 | |||
58 | if [ -d ~/.oh-my-zsh ] || [ -h ~/.oh-my-zsh ]; then | ||
59 | rm -rf ~/.oh-my-zsh | ||
56 | fi | 60 | fi |
57 | 61 | ||
58 | if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then | 62 | if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then |
59 | mv ~/.zshrc ~/.zshrc.pre-zsh-cnf | 63 | mv ~/.zshrc ~/.zshrc.pre-zsh-cnf |
60 | fi | 64 | fi |
65 | |||
61 | # | 66 | # |
62 | # BASH: | 67 | # BASH: |
63 | # | 68 | # |
64 | if [ -f ~/.bashrc ] || [ -h ~/.bashrc ]; then | 69 | if [ -f ~/.bashrc ] || [ -h ~/.bashrc ]; then |
65 | mv ~/.bashrc ~/.bashrc.pre-zsh-cnf | 70 | mv ~/.bashrc ~/.bashrc.pre-zsh-cnf |
66 | fi | 71 | fi |
67 | if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then | 72 | if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then |
68 | rm ~/.bash_aliases | 73 | rm ~/.bash_aliases |
69 | fi | 74 | fi |
70 | 75 | ||
71 | echo "\033[0;34mCloning Zsh Config...\033[0m" | 76 | echo "\033[0;34mCloning Zsh Config...\033[0m" |
72 | hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || { | 77 | hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || { |
73 | echo "can't clone repo.." | 78 | echo "can't clone repo.." |
74 | exit 1 | 79 | exit 1 |
75 | } | 80 | } |
76 | 81 | ||
77 | echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m" | 82 | echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m" |
78 | cp $ZCNF/templates/zshrc.sh ~/.zshrc | 83 | cp $ZCNF/templates/zshrc.sh ~/.zshrc |
79 | cp $ZCNF/templates/bashrc.sh ~/.bashrc | 84 | cp $ZCNF/templates/bashrc.sh ~/.bashrc |
80 | # ln -s $ZCNF/templates/bash_aliases.sh ~/.bash_aliases | 85 | # ln -s $ZCNF/templates/bash_aliases.sh ~/.bash_aliases |
81 | sed -i -e "/^export ZSH=/ c\\ | 86 | sed -i -e "/^export ZSH=/ c\\ |
82 | export ZSH=$ZSH | 87 | export ZSH=$ZSH |
83 | " ~/.zshrc | 88 | " ~/.zshrc |
84 | 89 | ||
85 | echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" | 90 | echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" |
86 | sed -i -e "/export PATH=/ c\\ | 91 | sed -i -e "/export PATH=/ c\\ |
87 | export PATH=\"$PATH\" | 92 | export PATH=\"$PATH\" |
88 | " ~/.zshrc | 93 | " ~/.zshrc |
89 | 94 | ||
90 | if [ "$SHELL" != "$(which zsh)" ]; then | 95 | if [ "$SHELL" != "$(which zsh)" ]; then |
91 | echo "\033[0;34mTime to change your default shell to zsh!\033[0m" | 96 | echo "\033[0;34mTime to change your default shell to zsh!\033[0m" |
92 | # echo "chsh -s $(which zsh)" | 97 | # echo "chsh -s $(which zsh)" |
93 | echo "chsh -s /bin/zsh" | 98 | echo "chsh -s /bin/zsh" |
94 | fi | 99 | fi |
95 | 100 | ||
96 | echo "\033[0;32m"' __ __ '"\033[0m" | 101 | echo "\033[0;32m"' __ __ '"\033[0m" |
97 | echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" | 102 | echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" |
98 | echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" | 103 | echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" |
99 | echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" | 104 | echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" |
100 | echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" | 105 | echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" |
101 | echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" | 106 | echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" |
102 | echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" | 107 | echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" |
103 | echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" | 108 | echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" |
104 | echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m" | 109 | echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m" |
105 | #env zsh | 110 | #env zsh |
106 | #. ~/.zshrc | 111 | #. ~/.zshrc |
107 | 112 |