diff options
| -rw-r--r-- | new.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -80,13 +80,17 @@ func guessPaths(path string) (string, string, string, bool, error) { realpath = filepath.Join(goSrcDir, path) isGoLang = true } + + if os.Getenv("REPO_AUTO_CLONE") == "true" { + clone(goSrcDir, path) + } + if !IsDirectory(realpath) { log.Log(REPOWARN, "directory doesn't exist", realpath) // directory doesn't exist. exit with nil and error nil return path, realpath, goSrcDir, false, errors.New(realpath + " does not exist") } - clone(goSrcDir, path) filename := filepath.Join(realpath, ".git/config") _, err = os.Open(filename) @@ -110,6 +114,7 @@ func clone(wdir string, path string) { } base := filepath.Join(wdir, filepath.Dir(path)) + os.MkdirAll(base, 0750) shell.RunPath(base, []string{"git", "clone", "http://" + path}) } |
