mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Rename gitloader to gitcloner.
This commit is contained in:
@@ -35,6 +35,18 @@ type gitCloner func(url string) (
|
|||||||
// Any error encountered when cloning.
|
// Any error encountered when cloning.
|
||||||
err error)
|
err error)
|
||||||
|
|
||||||
|
// isRepoUrl checks if a string is a repo Url
|
||||||
|
func isRepoUrl(s string) bool {
|
||||||
|
if strings.HasPrefix(s, "https://") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if strings.HasPrefix(s, "git::") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
host := strings.SplitN(s, "/", 2)[0]
|
||||||
|
return strings.Contains(host, ".com") || strings.Contains(host, ".org")
|
||||||
|
}
|
||||||
|
|
||||||
func makeTmpDir() (string, error) {
|
func makeTmpDir() (string, error) {
|
||||||
return ioutil.TempDir("", "kustomize-")
|
return ioutil.TempDir("", "kustomize-")
|
||||||
}
|
}
|
||||||
@@ -51,18 +63,6 @@ func hashicorpGitCloner(repoUrl string) (
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// isRepoUrl checks if a string is a repo Url
|
|
||||||
func isRepoUrl(s string) bool {
|
|
||||||
if strings.HasPrefix(s, "https://") {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if strings.HasPrefix(s, "git::") {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
host := strings.SplitN(s, "/", 2)[0]
|
|
||||||
return strings.Contains(host, ".com") || strings.Contains(host, ".org")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Checkout clones a github repo with specified commit/tag/branch
|
// Checkout clones a github repo with specified commit/tag/branch
|
||||||
func checkout(url, dir string) error {
|
func checkout(url, dir string) error {
|
||||||
pwd, err := os.Getwd()
|
pwd, err := os.Getwd()
|
||||||
Reference in New Issue
Block a user