diff options
| author | Jeff Carr <[email protected]> | 2025-02-14 18:40:55 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-14 18:40:55 -0600 |
| commit | 10f53c5f178e2303b7d3b011c1f9afbdc8c1c63e (patch) | |
| tree | 01c42eca3d4ab53564afc620cd0ac03c52722561 /doBuild.go | |
| parent | 7d4bb336b3cecec23e611ef420a7052f955200ad (diff) | |
general work on 'Build()'
Diffstat (limited to 'doBuild.go')
| -rw-r--r-- | doBuild.go | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/doBuild.go b/doBuild.go new file mode 100644 index 0000000..112a529 --- /dev/null +++ b/doBuild.go @@ -0,0 +1,47 @@ +// Copyright 2017-2025 WIT.COM Inc. All rights reserved. +// Use of this source code is governed by the GPL 3.0 + +package main + +import ( + "fmt" + + "go.wit.com/log" +) + +func doBuild() error { + v := []string{} + if argv.Verbose { + v = []string{"-v", "-x"} + } + + gopath := argv.Build + + repo := me.forge.FindByGoPath(gopath) + if repo == nil { + return fmt.Errorf("rep not found: %s", gopath) + } + if err := me.forge.Build(repo, v); err != nil { + log.Warn("Build failed:", repo.GetGoPath(), err) + return err + } + return nil +} + +func doInstall() error { + v := []string{} + if argv.Verbose { + v = []string{"-v", "-x"} + } + + gopath := argv.Install + repo := me.forge.FindByGoPath(gopath) + if repo == nil { + return fmt.Errorf("rep not found: %s", gopath) + } + if err := me.forge.Install(repo, v); err != nil { + log.Warn("Install failed", repo.GetGoPath(), err) + return err + } + return nil +} |
