Skip to content

Instantly share code, notes, and snippets.

@asalant
Created February 18, 2012 06:13
Show Gist options
  • Select an option

  • Save asalant/1857778 to your computer and use it in GitHub Desktop.

Select an option

Save asalant/1857778 to your computer and use it in GitHub Desktop.
Bash/zsh/... function for simpler heroku command line usage with multiple apps for the same project.
# Alias heroku for simpler multi-app projects
heroku-app() {
args=("$@")
if [ "${args[1]}" = "staging" ]; then
args+=("--app" "goodeggs-garbanzo-staging")
index=1
elif [ "${args[1]}" = "production" ]; then
args+=("--app" "goodeggs-garbanzo")
index=1
else
index=0
fi
echo "Running heroku ${args[@]:$index}..."
heroku ${args[@]:$index}
}
alias heroku=heroku-app
@randypuro
Copy link

It appears on bash that I need to test args[0].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment