Skip to content
Browse files

abstracted out the heroku domain that is used for git authentications…

…, so that it is compatible with the heroku-accounts plugin
  • Loading branch information...
1 parent 92b0ede commit 6410c21978a68fa1178faed57dda30f446379225 @ricaurte ricaurte committed Jan 19, 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 6410c21

Please sign in to comment.
Something went wrong with that request. Please try again.