Created
October 9, 2014 14:20
-
-
Save neilkimmett/66003d75fcef8aa24a95 to your computer and use it in GitHub Desktop.
When you have multiple heroku apps, for one repo, you're going to need a hero! hero production run rake db:migrate
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
function __hero_get_remote_names | |
git config --get-regexp 'remote.*.url' heroku.com | sed -E 's/^remote\.([^\.]*)\.url .*$/\1/' | |
end | |
function __hero_heroku_app_for | |
git config --get remote.$argv[1].url | sed -E 's/^[email protected]:([^.]*)\.git/\1/' | |
end | |
function __hero_completion | |
__hero_get_remote_names $argv[1] | |
end | |
function hero | |
set APP (__hero_heroku_app_for $argv[1]) | |
heroku $argv[2..-1] --app $APP | |
end | |
complete -f --command hero --arguments '(__hero_completion (commandline -cp))' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment