Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Aug 16, 2016
1 parent 5ea4c59 commit 630fcbd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions project/git.go
Expand Up @@ -13,7 +13,9 @@ type gitProject struct {
folder string
}

func NewGit(targetFolder, repo, version string) Project {
// NewGit A git project can be any repository in any given branch. It will
// be downloaded to the provided cwd
func NewGit(cwd, repo, version string) Project {
var url string
switch {
case strings.HasPrefix(repo, "http://"):
Expand All @@ -29,7 +31,7 @@ func NewGit(targetFolder, repo, version string) Project {
default:
url = "https://github.com/" + repo
}
folder := targetFolder + strings.Replace(
folder := cwd + strings.Replace(
strings.Replace(
url, ":", "-COLON-", -1,
), "/", "-SLASH-", -1,
Expand Down
1 change: 1 addition & 0 deletions project/local.go
@@ -1,5 +1,6 @@
package project

// NewLocal Returns a local project, which can be any folder you want to
func NewLocal(folder string) Project {
return localProject{folder}
}
Expand Down

0 comments on commit 630fcbd

Please sign in to comment.