58d2f9335d21a30a85d47c820203e00c1f3d5be7

Author
Chang Hyun Park <heartinpiece@gmail.com>
Committer
Chang Hyun Park <heartinpiece@gmail.com>
Date

Message

Check if Zsh is installed prior to installing Oh My Zsh

Check if Zsh is installed before installing anything else.
New-commers, or people who don't read the disclaimers(ex. me) will go
straight to stack overflow if chsh -s returns an error.

Diff

 1diff --git a/tools/install.sh b/tools/install.sh
 2index c83a6f23d0776abec9a189f90d0846d8d3036ab0..9517377548b7faff128718f43bd6451b69900684 100755
 3--- a/tools/install.sh
 4+++ b/tools/install.sh
 5@@ -1,5 +1,12 @@
 6 set -e
 7 
 8+CHECK_ZSH_INSTALLED=$(grep /zsh$ /etc/shells | wc -l)
 9+if [ ! $CHECK_ZSH_INSTALLED -ge 1 ]; then
10+  echo "\033[0;33m Zsh is not installed!\033[0m Please install zsh first!"
11+  exit
12+fi
13+unset CHECK_ZSH_INSTALLED
14+
15 if [ ! -n "$ZSH" ]; then
16   ZSH=~/.oh-my-zsh
17 fi