From b5d30727293f74c27d19e990245569ed2ba02083 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 17 Nov 2024 16:04:08 -0600 Subject: [PATCH] fix recursive logic --- main.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/main.go b/main.go index a3460dc..04614e6 100644 --- a/main.go +++ b/main.go @@ -61,6 +61,9 @@ func main() { if argv.Recursive || argv.Pull || argv.RedoGoMod { log.Info("repo already cloned", filepath.Join(wdir, argv.Repo)) // there is more to do + log.Info("argv.Recursive is", argv.Recursive) + log.Info("argv.Pull is", argv.Pull) + log.Info("argv.RedoGoMod is", argv.RedoGoMod) log.Info("onward and upward") } else { log.Info("repo already cloned", filepath.Join(wdir, argv.Repo)) @@ -84,6 +87,17 @@ func main() { log.Info("could not download:", err) os.Exit(-1) } + if argv.Recursive || argv.Pull || argv.RedoGoMod { + log.Info("repo already cloned", filepath.Join(wdir, argv.Repo)) + // there is more to do + log.Info("argv.Recursive is", argv.Recursive) + log.Info("argv.Pull is", argv.Pull) + log.Info("argv.RedoGoMod is", argv.RedoGoMod) + log.Info("onward and upward") + } else { + log.Info("repo cloned worked to", filepath.Join(wdir, argv.Repo)) + os.Exit(0) + } // update go.sum and go.mod // todo: only do this if they don't exist? @@ -98,6 +112,7 @@ func main() { } } + os.Setenv("REPO_AUTO_CLONE", "false") // look recursively in your working directory for git repos totalcount := scanForRepos(wdir) @@ -134,6 +149,7 @@ func main() { log.Info("how did this repo still not exist?", argv.Repo) os.Exit(-1) } + os.Setenv("REPO_AUTO_CLONE", "true") godep := newr.Status.GetGoDeps() for gopath, version := range godep { repo, err := rv.NewRepo(gopath)