Created
February 18, 2012 06:13
-
-
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.
This file contains hidden or 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
| # 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It appears on bash that I need to test args[0].