Skip to content

Instantly share code, notes, and snippets.

@ivanacostarubio
Created November 24, 2009 20:23
Show Gist options
  • Save ivanacostarubio/242178 to your computer and use it in GitHub Desktop.
Save ivanacostarubio/242178 to your computer and use it in GitHub Desktop.
def create
remote = extract_option('--remote', 'heroku')
name = args.shift.downcase.strip rescue nil
name = heroku.create(name, {})
display "Created #{app_urls(name)}"
if remote || File.exists?(Dir.pwd + '/.git')
remote ||= 'heroku'
return if shell('git remote').split("\n").include?(remote)
shell "git remote add #{remote} git@#{heroku.host}:#{name}.git"
display "Git remote #{remote} added"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment