add button for checking go.sum
This commit is contained in:
parent
1fe0354822
commit
81a1801223
28
addRepo.go
28
addRepo.go
|
@ -183,22 +183,18 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str
|
|||
}
|
||||
newRepo.Status.Toggle()
|
||||
})
|
||||
|
||||
var showBuildB bool = false
|
||||
switch newRepo.Status.RepoType() {
|
||||
case "binary":
|
||||
// log.Info("compile here. Show()")
|
||||
showBuildB = true
|
||||
case "library":
|
||||
// log.Info("library here. Hide()")
|
||||
default:
|
||||
// log.Info("unknown RepoType", newRepo.Status.RepoType())
|
||||
}
|
||||
if showBuildB {
|
||||
newRepo.endBox.NewButton("build", func() {
|
||||
newRepo.Status.Build()
|
||||
})
|
||||
}
|
||||
newRepo.endBox.NewButton("CheckValidGoSum()", func() {
|
||||
ok, err := r.CheckValidGoSum(newRepo)
|
||||
if err != nil {
|
||||
log.Info("go mod tidy did not work err =", err)
|
||||
return
|
||||
}
|
||||
if ok {
|
||||
log.Info("repo has go.sum requirements that are clean")
|
||||
newRepo.goState.SetText("GOOD")
|
||||
return
|
||||
}
|
||||
})
|
||||
default:
|
||||
}
|
||||
grid.NextRow()
|
||||
|
|
2
flags.go
2
flags.go
|
@ -16,5 +16,5 @@ func init() {
|
|||
short := "repo"
|
||||
|
||||
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")
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ func (rl *RepoList) CheckValidGoSum(r *Repo) (bool, error) {
|
|||
log.Log(REPOWARN, "CheckValidGoSum() started")
|
||||
ok, err := r.Status.MakeRedomod()
|
||||
if !ok {
|
||||
log.Log(REPOWARN, "CheckValidGoSum() failed", err)
|
||||
log.Log(REPOWARN, "CheckValidGoSum() MakeRedomod() failed", err)
|
||||
return ok, err
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ type RepoList struct {
|
|||
|
||||
shownCount *gui.Node
|
||||
hideFunction func(*Repo)
|
||||
duration *gui.Node
|
||||
duration *gui.Node
|
||||
}
|
||||
|
||||
type Repo struct {
|
||||
|
|
Loading…
Reference in New Issue