Skip to content

Instantly share code, notes, and snippets.

@scootklein
Created November 2, 2012 16:12
Show Gist options
  • Save scootklein/4002367 to your computer and use it in GitHub Desktop.
Save scootklein/4002367 to your computer and use it in GitHub Desktop.
shell functions for running commands against heroku product and staging envs
function hp() {
orig_args="$@"
remotes=`git remote -v | grep production | grep -v worker`
set $remotes
repo=${2/git@heroku.com:/}
hp_predicate=${repo/.git/};
echo "heroku $orig_args --app $hp_predicate"
heroku $orig_args --app $hp_predicate
}
function hs() {
orig_args="$@"
remotes=`git remote -v | grep staging | grep -v worker`
set $remotes
repo=${2/git@heroku.com:/}
hp_predicate=${repo/.git/};
echo "heroku $orig_args --app $hp_predicate"
heroku $orig_args --app $hp_predicate
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment