Created
March 3, 2013 09:11
-
-
Save lukaskonarovsky/5075410 to your computer and use it in GitHub Desktop.
This is how to check dependencies for local development. Save as setup/check into rails app.
This file contains 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
#!/usr/bin/env bash | |
function dependency { | |
$2 > /dev/null 2>&1 | |
if [[ "$?" == "0" ]] ; then | |
echo "$1 installed" | |
else | |
echo "To install $1: '$3'" | |
fi | |
} | |
# name | command | how to install | |
# ---------------|---------------------|------------------------------------- | |
dependency "rbenv" "rbenv --version" "brew install rbenv ruby-build" | |
dependency "bundler" "bundle -v" "gem install bundler" | |
dependency "powder" "powder -v" "gem install powder" | |
dependency "postgresql" "psql --version" "brew install postgresql" | |
dependency "elasticsearch" "elasticsearch -h" "brew install elasticsearch" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example output: