summaryrefslogtreecommitdiff
path: root/doBuild.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-03 15:04:11 -0500
committerJeff Carr <[email protected]>2025-10-03 15:04:11 -0500
commitdeed575dd7f1ef60477065f6e543a57faa08aa4d (patch)
tree62ce201144c3be3b214d4e45898e1c1a6a35ff8a /doBuild.go
parentf19039b4ae20fbf01248da9fbdf97ef93c7080d0 (diff)
working through logic to improve the codev0.1.2
Diffstat (limited to 'doBuild.go')
-rw-r--r--doBuild.go27
1 files changed, 13 insertions, 14 deletions
diff --git a/doBuild.go b/doBuild.go
index dcf3987..d99215f 100644
--- a/doBuild.go
+++ b/doBuild.go
@@ -7,6 +7,7 @@ import (
"fmt"
"os"
"path/filepath"
+ "strings"
"go.wit.com/lib/gui/shell"
"go.wit.com/lib/protobuf/gitpb"
@@ -53,13 +54,11 @@ func doInstallRepo(check *gitpb.Repo) error {
verbose := []string{"-v", "-x"}
if err := me.forge.Install(check, verbose); err != nil {
log.Warn("INSTALL FAILED", check.GetGoPath(), err)
- failed[check] = fmt.Sprintf("%s %s %v", "go install", check.GetGoPath(), err)
return err
}
} else {
if err := me.forge.Install(check, nil); err != nil {
log.Warn("INSTALL FAILED", check.GetGoPath(), err)
- failed[check] = fmt.Sprintf("%s %s %v", "go install", check.GetGoPath(), err)
return err
}
}
@@ -67,8 +66,6 @@ func doInstallRepo(check *gitpb.Repo) error {
}
func doInstallScan() {
- initForge() // make sure forge is init'd here
-
all := me.forge.Repos.SortByFullPath()
for all.Scan() {
check := all.Next()
@@ -86,13 +83,14 @@ func doInstallScan() {
continue
}
+ if check.GetState() == "" || check.GetState() == "PERFECT" {
+ check.State = "need to build"
+ }
+
// var cmd []string
var start string
var end string
- // add te repotype
- end += check.GetRepoType()
-
manufactured := check.GetCurrentVersion()
ver := trimNonNumericFromStart(manufactured)
name := me.forge.Config.DebName(check.GetGoPath())
@@ -132,16 +130,17 @@ func doInstallScan() {
// log.Info(debname, "does not exist")
}
- if check.GetState() == "" {
- check.State = "need to build"
- }
- start = fmt.Sprintf("%-15s %-20s %-50s", check.GetState(), ver, debname)
+ start = fmt.Sprintf("%-18s %-24s %-50s", check.GetState(), ver, debname)
if check.GetState() == "need to build" {
- end += " (will build) "
+ end = "(will build)" + end
}
- log.Info(start, end)
+ end = strings.TrimSpace(end)
+ if end == "" {
+ end = check.GetState()
+ }
+ log.Info(start, check.GetRepoType(), end)
if name == "" {
// err := fmt.Sprintf("name is blank error %+v", repo)
log.Warn("name is blank error", check.GetGoPath())
@@ -151,6 +150,7 @@ func doInstallScan() {
func doInstall() error {
initForge()
+ doInstallScan()
found := gitpb.NewRepos()
for check := range me.forge.Repos.IterAll() {
@@ -170,7 +170,6 @@ func doInstall() error {
me.forge.PrintForgedTable(found)
if argv.DryRun {
- doInstallScan()
okExit("")
}