summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go39
1 files changed, 20 insertions, 19 deletions
diff --git a/main.go b/main.go
index 6f15a74..93ed536 100644
--- a/main.go
+++ b/main.go
@@ -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