add button for checking go.sum

This commit is contained in:
Jeff Carr 2024-02-20 18:55:50 -06:00
parent 1fe0354822
commit 81a1801223
4 changed files with 15 additions and 19 deletions

View File

@ -183,22 +183,18 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str
} }
newRepo.Status.Toggle() newRepo.Status.Toggle()
}) })
newRepo.endBox.NewButton("CheckValidGoSum()", func() {
var showBuildB bool = false ok, err := r.CheckValidGoSum(newRepo)
switch newRepo.Status.RepoType() { if err != nil {
case "binary": log.Info("go mod tidy did not work err =", err)
// log.Info("compile here. Show()") return
showBuildB = true }
case "library": if ok {
// log.Info("library here. Hide()") log.Info("repo has go.sum requirements that are clean")
default: newRepo.goState.SetText("GOOD")
// log.Info("unknown RepoType", newRepo.Status.RepoType()) return
} }
if showBuildB { })
newRepo.endBox.NewButton("build", func() {
newRepo.Status.Build()
})
}
default: default:
} }
grid.NextRow() grid.NextRow()

View File

@ -16,5 +16,5 @@ func init() {
short := "repo" short := "repo"
REPO = log.NewFlag("REPO", false, full, short, "general repo things") REPO = log.NewFlag("REPO", false, full, short, "general repo things")
REPOWARN = log.NewFlag("REPOWARN", true, full, short, "general repo things") REPOWARN = log.NewFlag("REPOWARN", true, full, short, "repo warnings")
} }

View File

@ -15,7 +15,7 @@ func (rl *RepoList) CheckValidGoSum(r *Repo) (bool, error) {
log.Log(REPOWARN, "CheckValidGoSum() started") log.Log(REPOWARN, "CheckValidGoSum() started")
ok, err := r.Status.MakeRedomod() ok, err := r.Status.MakeRedomod()
if !ok { if !ok {
log.Log(REPOWARN, "CheckValidGoSum() failed", err) log.Log(REPOWARN, "CheckValidGoSum() MakeRedomod() failed", err)
return ok, err return ok, err
} }

View File

@ -33,7 +33,7 @@ type RepoList struct {
shownCount *gui.Node shownCount *gui.Node
hideFunction func(*Repo) hideFunction func(*Repo)
duration *gui.Node duration *gui.Node
} }
type Repo struct { type Repo struct {