Merge pull request #361 from mdelagralfo/git-credential-fix
fixing git credential helper for GitHub Enterprise
This commit is contained in:
commit
e17ecb112f
1 changed files with 4 additions and 1 deletions
|
@ -25,8 +25,11 @@ require "boxen/config"
|
|||
config = Boxen::Config.load
|
||||
input = $stdin.read
|
||||
attrs = Hash[input.split($/).map { |l| l.split("=") }]
|
||||
# find GitHub or GitHub Enterprise host
|
||||
ghhost = URI(config.ghurl).host
|
||||
|
||||
if command == "get" && attrs["host"] =~ /(^|\.)github\.com$/
|
||||
host_exp = Regexp.new "(^|\.)" + Regexp.escape(ghhost)
|
||||
if command == "get" && host_exp.match(attrs["host"])
|
||||
puts "username=#{config.token}"
|
||||
puts "password=x-oauth-basic"
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue