diff options
| author | Jeff Carr <[email protected]> | 2024-03-21 19:43:26 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-03-21 19:43:26 -0500 |
| commit | 7a095d15667b683d310bd82215149bc748fcb9c9 (patch) | |
| tree | ab43457d5ed3de84caa4fdfae43f2be288b3aae6 /main.go | |
| parent | f09d0fbfa9a9ffb037943fecdab13f0e53212850 (diff) | |
add --recursive
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 39 |
1 files changed, 20 insertions, 19 deletions
@@ -14,20 +14,16 @@ import ( "go.wit.com/log" ) -var VERSION string +var Version string var rv *repolist.RepoList var myargs args func main() { - arg.MustParse(&myargs) + pp := arg.MustParse(&myargs) if myargs.Repo == "" { - // tmp.WriteHelp(os.Stdout) - // fmt.Println("hello world") - tmp := myargs.Description() - fmt.Println(tmp) - fmt.Println(myargs.Version()) + pp.WriteHelp(os.Stdout) os.Exit(0) } @@ -61,32 +57,37 @@ func main() { } godep := newr.Status.GetGoDeps() - for gopath, version := range godep { - repo, err := rv.NewRepo(gopath) - if err != nil { - log.Info("git clone failed for", gopath, version) - continue + if myargs.Recursive { + for gopath, version := range godep { + repo, err := rv.NewRepo(gopath) + if err != nil { + log.Info("git clone failed for", gopath, version) + continue + } + repo.Status.MakeRedomod() } - repo.Status.MakeRedomod() } + var count int for _, repo := range rv.AllRepos() { - if ! repo.Status.Exists("go.mod") { + count += 1 + if !repo.Status.Exists("go.mod") { repo.Status.MakeRedomod() } } - log.Info("all repositories are cloned") + log.Info("Total repositories:", count) if !myargs.NoWork { log.Info("Creating", wdir+"/go.work") rv.MakeGoWork() shell.RunPath(wdir, []string{"go", "work", "use"}) } - for _, repo := range rv.AllRepos() { - log.Info("found repo", repo.GoPath(), repo.Status.Path()) - } - + /* + for _, repo := range rv.AllRepos() { + log.Info("found repo", repo.GoPath(), repo.Status.Path()) + } + */ } // look for or make a go.work file |
