summaryrefslogtreecommitdiff
path: root/doBuild.go
diff options
context:
space:
mode:
Diffstat (limited to 'doBuild.go')
-rw-r--r--doBuild.go47
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
+}