Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#!/bin/bash
case "$1" in
production) environment=production; shift;;
staging) environment=staging; shift;;
* environment = staging;;
esac
case "$environment" in
staging) app=my-app-staging;;
production) app=my-app-production;;
esac
echo_exec() {
echo " -> $@"
$@
}
run() {
echo_exec "heroku run $@ --app $app"
}
case "$1" in
run) $@;;
console) run rails console;;
*)
echo "Error."
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment