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