diff options
author | Andrew Janke <andrew@apjanke.net> | 2015-08-31 13:29:54 -0400 |
---|---|---|
committer | Andrew Janke <andrew@apjanke.net> | 2015-09-03 12:50:55 -0400 |
commit | 82c76f6b5c2718622a532fb759231e8d24171413 (patch) | |
tree | b0126f6d9b3ed508c1a6d9b21df56e2523e0555f /tools/install.sh | |
parent | fe92ea98e0633784508e85d6b756b1c3f667b2a4 (diff) | |
parent | ba5fd57c1ff4a8523715bab6acc35dbbeff88af7 (diff) | |
download | zsh-82c76f6b5c2718622a532fb759231e8d24171413.tar.gz zsh-82c76f6b5c2718622a532fb759231e8d24171413.tar.bz2 zsh-82c76f6b5c2718622a532fb759231e8d24171413.zip |
Merge changes from #4241 into installer-portable-colors
Conflicts:
tools/install.sh
tools/upgrade.sh
Diffstat (limited to 'tools/install.sh')
-rwxr-xr-x | tools/install.sh | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/install.sh b/tools/install.sh index beec750c3..e8dffe3c7 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -18,6 +18,12 @@ else BOLD="" NORMAL="" fi +CHECK_ZSH_INSTALLED=$(grep /zsh$ /etc/shells | wc -l) +if [ ! $CHECK_ZSH_INSTALLED -ge 1 ]; then + echo "${YELLOW}Zsh is not installed!${NORMAL} Please install zsh first!" + exit +fi +unset CHECK_ZSH_INSTALLED if [ ! -n "$ZSH" ]; then ZSH=~/.oh-my-zsh @@ -43,14 +49,16 @@ fi printf "${BLUE}Using the Oh My Zsh template file and adding it to ~/.zshrc${NORMAL}\n" cp $ZSH/templates/zshrc.zsh-template ~/.zshrc -sed -i -e "/^export ZSH=/ c\\ +sed "/^export ZSH=/ c\\ export ZSH=$ZSH -" ~/.zshrc +" ~/.zshrc > ~/.zshrc-omztemp +mv -f ~/.zshrc-omztemp ~/.zshrc printf "${BLUE}Copying your current PATH and adding it to the end of ~/.zshrc for you.${NORMAL}\n" -sed -i -e "/export PATH=/ c\\ +sed "/export PATH=/ c\\ export PATH=\"$PATH\" -" ~/.zshrc +" ~/.zshrc > ~/.zshrc-omztemp +mv -f ~/.zshrc-omztemp ~/.zshrc TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)') if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then |