a39c9ffe5b7236b6e4dc78efa80b478cc411af7f

Author
Renan Cakirerk <renan@cakirerk.org>
Committer
Renan Cakirerk <renan@cakirerk.org>
Date

Message

Fix finding git issue. http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script

Diff

 1diff --git a/tools/install.sh b/tools/install.sh
 2index 8ca427d2caf3620d141b043ab333a005aeaf47ea..b080be3a115c4d9b6feaa3368bbd7e1c9451e84e 100755
 3--- a/tools/install.sh
 4+++ b/tools/install.sh
 5@@ -5,13 +5,10 @@ then
 6 fi
 7 
 8 echo "\033[0;34mCloning Oh My Zsh...\033[0m"
 9-which git > /dev/null
10-if [[ $? -eq 0 ]]; then
11-  /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
12-else
13+hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh || {
14   echo "git not installed"
15   exit
16-fi
17+}
18 
19 echo "\033[0;34mLooking for an existing zsh config...\033[0m"
20 if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]