Skip to content

Commit

Permalink
Merge pull request #891 from flovilmart/github-access-token-enhancements
Browse files Browse the repository at this point in the history
Uses github access token to clone https URLs for github repos
  • Loading branch information
mdiep committed Nov 5, 2015
2 parents 35924f3 + d0aa99f commit 6001112
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/CarthageKit/GitHub.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,13 @@ public struct GitHubRepository: Equatable {

/// The URL that should be used for cloning this repository over HTTPS.
public var HTTPSURL: GitURL {
return GitURL("\(server)/\(owner)/\(name).git")
let gitAuth = parseGitHubAccessTokenFromEnvironment()

var serverAuth:String = ""
if let auth = gitAuth[server.hostname] {
serverAuth = "\(auth)@"
}
return GitURL("\(server.scheme)://\(serverAuth)\(server.hostname)/\(owner)/\(name).git")
}

/// The URL that should be used for cloning this repository over SSH.
Expand Down

0 comments on commit 6001112

Please sign in to comment.