diff --git a/download/download.go b/download/download.go index fa8d01f..7dcd9a6 100644 --- a/download/download.go +++ b/download/download.go @@ -3,6 +3,7 @@ package download import ( "errors" "log" + "net/url" "os" "path/filepath" "strings" @@ -63,7 +64,17 @@ func download(path, dest string, firstAttempt bool) (root *vcs.RepoRoot, err err if root.VCS.Name == "Git" { root.VCS.CreateCmd = "clone --depth 1 {repo} {dir}" } - err = root.VCS.Create(fullLocalPath, root.Repo) + var rootRepo = root.Repo + u, err := url.Parse(root.Repo) + if err != nil { + log.Printf("WARN: could not parse root.Repo: %v", err) + } else { + if u.Host == "github.com" { + u.User = url.UserPassword("gojp", "gojp") + rootRepo = u.String() + } + } + err = root.VCS.Create(fullLocalPath, rootRepo) if err != nil { return root, err }