Last active
August 29, 2015 14:03
-
-
Save urfolomeus/1cecf1fcfc9cc0e8f6e3 to your computer and use it in GitHub Desktop.
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
##heroku | |
alias hp="heroku_helper production" | |
alias hs="heroku_helper staging" | |
alias hpc="heroku_helper production run console" | |
alias hpl="heroku_helper production logs" | |
alias hprdbm="heroku_helper production run rake db:migrate" | |
alias hsc="heroku_helper staging run console" | |
alias hsl="heroku_helper staging logs" | |
alias hsrdbm="heroku_helper staging run rake db:migrate" |
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 ruby | |
class String | |
def urlize | |
self.gsub(/[^a-zA-Z-]/, '-') | |
end | |
end | |
env, command_name, *args = ARGV | |
env = nil if env == 'production' | |
app = Dir.pwd.split('/').last.urlize | |
app << "-#{env}" if env | |
command = "heroku #{command_name} #{args.join(' ')} --app #{app}" | |
puts command | |
exec command |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment