Created
July 22, 2014 16:49
-
-
Save cybertk/21de6dd86e166236fcbd to your computer and use it in GitHub Desktop.
Auto append --app to heroku bin according to ENV['HEROKU_APP']
This file contains 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
#!/usr/bin/env python | |
# | |
# A simple wrapper support select app by reading from environment vars and | |
# auto append the --app to origin heroku bin. | |
# | |
# Last-updated: Fri Dec 6 17:19:07 CST 2013 by quanlong. | |
import sys | |
import os | |
import subprocess | |
# Delegate to heroku binary. | |
sys.argv[0] = '/usr/bin/heroku' | |
if len(sys.argv) > 2 and 'HEROKU_APP' in os.environ: | |
sys.argv.insert(2, '--app') | |
sys.argv.insert(3, os.environ['HEROKU_APP']) | |
print sys.argv | |
subprocess.call(sys.argv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment