Skip to content

Instantly share code, notes, and snippets.

@allspiritseve
Created May 28, 2015 15:32
Show Gist options
  • Save allspiritseve/66950b337dd30d138f43 to your computer and use it in GitHub Desktop.
Save allspiritseve/66950b337dd30d138f43 to your computer and use it in GitHub Desktop.
#!/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