diff options
| author | Jeff Carr <[email protected]> | 2024-12-01 22:21:34 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-01 22:21:34 -0600 |
| commit | 5155f8038eb854c64efafcf5f2e9ef0f88cb6630 (patch) | |
| tree | daff9be8f34e9629c2c27fd53ea63e5bed512f46 /main.go | |
| parent | 106f1403c699e1025d4b4dcebf7ead2608e62a76 (diff) | |
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 39 |
1 files changed, 27 insertions, 12 deletions
@@ -82,17 +82,26 @@ func main() { clone() autoWork() - build() - if argv.Repo == "" { - pp.WriteHelp(os.Stdout) - os.Exit(0) + if argv.Install { + if err := forge.Install(argvRepo, nil); err == nil { + okExit("install worked") + } else { + badExit(err) + } } - okExit(argv.Repo) + if argv.Build { + if err := forge.Build(argvRepo, nil); err == nil { + okExit("build worked") + } else { + badExit(err) + } + } + okExit("skipping build of " + argv.Repo) } func okExit(thing string) { - log.Info("Total repositories:", forge.Repos.Len()) - log.Info("Finished go-clone", thing, "ok") + log.Info(thing, "ok") + log.Info("Finished clone on", argvRepo.GetGoPath(), "ok") os.Exit(0) } @@ -199,13 +208,19 @@ func redoGoModAll() { } } -func build() { +func build() error { + if argv.Install { + if err := forge.Install(argvRepo, nil); err == nil { + okExit("install worked") + } else { + badExit(err) + } + } if argv.Build { - log.Info("need to try to build here") - forge.Build(argvRepo, nil) - } else { - log.Info("skipping build") + return forge.Build(argvRepo, nil) } + log.Info("skipping build") + return nil } func autoWork() { |
