From dc0040f0805e7a8ab3f47ea0e5ebffb03eda2b62 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 18 Feb 2024 15:09:35 -0600 Subject: [PATCH] guireleaser runs again --- addRepo.go | 8 +++++--- common.go | 24 ++++++++++++++++++++++++ scan.go | 2 +- watchdog.go | 2 +- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/addRepo.go b/addRepo.go index c09d1b1..c8d054f 100644 --- a/addRepo.go +++ b/addRepo.go @@ -21,6 +21,7 @@ func (r *Repo) Hide() { r.endBox.Hide() // r.statusButton.Hide() // r.diffButton.Hide() + r.goSumStatus.Hide() r.hidden = true } @@ -41,6 +42,7 @@ func (r *Repo) Show() { r.endBox.Show() // r.statusButton.Show() // r.diffButton.Show() + r.goSumStatus.Show() r.hidden = false } @@ -138,9 +140,10 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str } newRepo.goSumStatus = r.blind.NewLabel("in the blind") case "guireleaser": - newRepo.develVersion = grid.NewLabel("").SetProgName("develVersion") - newRepo.userVersion = grid.NewLabel("").SetProgName("userVersion") + newRepo.develVersion = r.blind.NewLabel("").SetProgName("develVersion") + newRepo.userVersion = r.blind.NewLabel("").SetProgName("userVersion") newRepo.dirtyLabel = grid.NewLabel("") + newRepo.goSumStatus = grid.NewLabel("in the blind") newRepo.vLabel = grid.NewLabel("").SetProgName("current") newRepo.endBox = grid.NewHorizontalBox("HBOX") newRepo.endBox.NewButton("Configure", func() { @@ -168,7 +171,6 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str newRepo.Status.Build() }) } - newRepo.goSumStatus = r.blind.NewLabel("in the blind") default: } grid.NextRow() diff --git a/common.go b/common.go index 6f3ab4e..2374b33 100644 --- a/common.go +++ b/common.go @@ -16,6 +16,11 @@ func (r *RepoList) Hide() { r.reposbox.Hide() } +func (r *RepoList) FindRepo(path string) *Repo { + repo, _ := me.allrepos[path] + return repo +} + func (r *RepoList) AllRepos() []*Repo { var all []*Repo for _, repo := range me.allrepos { @@ -71,6 +76,25 @@ func (r *Repo) ReadOnly() bool { return r.Status.ReadOnly() } +func (r *Repo) LastTag() string { + return r.Status.GetLastTagVersion() +} + +// returns the state of the GO go.mod and go.sum files +// this is used to tell if they are valid and correctly reflect +// the versions of the other GUI packages +// at this point in time, there is _NO_ way to be check our +// be sure that anything will run with older versions +// because this are changing too often at this point +// TODO: revisit this in 2025 or 2026 +func (r *Repo) GoState() string { + return r.Status.GetGoSumStatus() +} + +func (r *Repo) SetGoState(s string) { + r.Status.SetGoSumStatus(s) +} + func (r *Repo) IsPerfect() bool { if r.dirtyLabel.String() == "PERFECT" { return true diff --git a/scan.go b/scan.go index fa4e733..4311dd1 100644 --- a/scan.go +++ b/scan.go @@ -14,7 +14,7 @@ func (r *RepoList) SetAutoScan(b bool) { func (r *RepoList) ScanRepositories() (int, string) { var i int - t := timeFunction(func() { + t := TimeFunction(func() { for _, repo := range me.allrepos { i += 1 repo.NewScan() diff --git a/watchdog.go b/watchdog.go index 9b136f4..1dbb2f4 100644 --- a/watchdog.go +++ b/watchdog.go @@ -47,7 +47,7 @@ func (r *RepoList) Watchdog(f func()) { } // timeFunction takes a function as an argument and returns the execution time. -func timeFunction(f func()) time.Duration { +func TimeFunction(f func()) time.Duration { startTime := time.Now() // Record the start time f() // Execute the function return time.Since(startTime) // Calculate the elapsed time