Created
February 26, 2015 17:42
-
-
Save tmlbl/30f5386b692e912bd640 to your computer and use it in GitHub Desktop.
Bash script to check for required executables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
test_exec() { | |
echo -e "Checking for command: \e[34m$1\e[0m" | |
EX=$(which $1) | |
if [[ ! "$EX" ]]; then | |
echo -e "\e[31mUh oh! It looks like you need to install $1:" | |
echo -e "$2\e[0m" | |
exit 1 | |
else | |
echo -e "\e[32m$EX\e[0m" | |
fi | |
} | |
test_exec "thrift" "https://thrift.apache.org/" | |
test_exec "git" "http://git-scm.com/" | |
test_exec "sbt" "http://www.scala-sbt.org/" | |
test_exec "make" "http://www.gnu.org/software/make/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment