Permalink
Browse files

Merge pull request #8 from ricaurte/master

Needed Vulcan to work with Heroku-Accounts plugin so I made this patch
  • Loading branch information...
2 parents 92b0ede + 6410c21 commit de0e4d39ae7e737a2a755e5f1bf06a9a7b6007b2 @ddollar ddollar committed Jan 25, 2012
Showing with 12 additions and 1 deletion.
  1. +12 −1 lib/vulcan/cli.rb
View
13 lib/vulcan/cli.rb
@@ -129,7 +129,7 @@ def index
error "invalid api key detected, try running `heroku credentials`" if api_key =~ / /
system "git init"
- system "git remote add heroku git@heroku.com:#{config[:app]}.git"
+ system "git remote add heroku git@#{heroku_git_domain}:#{config[:app]}.git"
FileUtils.cp_r "#{server_path}/.", "."
File.open(".gitignore", "w") do |file|
file.puts ".env"
@@ -179,5 +179,16 @@ def error(message)
def server_path
File.expand_path("../../../server", __FILE__)
end
+
+ #
+ # heroku_git_domain checks to see if the heroku-accounts plugin is present,
+ # and if so, it will set the domain to the one that matches the credentials
+ # for the currently set account
+ #
+ def heroku_git_domain
+ suffix = %x{ git config heroku.account }
+ suffix = "com" if suffix.nil? or suffix.strip == ""
+ "heroku.#{suffix.strip}"
+ end
end

0 comments on commit de0e4d3

Please sign in to comment.