From 23b2b26643596aa1aeba229067b14a97d297f8bf Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 17 Dec 2024 13:13:34 -0600 Subject: formatting for releases --- human.go | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) (limited to 'human.go') diff --git a/human.go b/human.go index 06caa9a..af307ae 100644 --- a/human.go +++ b/human.go @@ -51,20 +51,20 @@ func (f *Forge) ConfigPrintTable() { // show information while doing golang releases func (f *Forge) StandardReleaseHeader(repo *gitpb.Repo, state string) string { - lastTag := repo.GetLastTag() // tag := repo.NewestTag() // gitAge, _ := tag.GetDate() dur := repo.NewestAge() curname := repo.GetCurrentBranchName() + + lastTag := repo.GetLastTag() + target := repo.GetTargetVersion() master := repo.GetMasterVersion() user := repo.GetUserVersion() - target := repo.GetTargetVersion() header := fmt.Sprintf("%-35s %5s %-10s %-10s %-10s %-20s %-20s %-15s", repo.GetGoPath(), shell.FormatDuration(dur), curname, - lastTag, target, - master, user, + lastTag, target, master, user, state) return header } @@ -76,3 +76,32 @@ func ReleaseReportHeader() string { "MASTER", "USER", "STATE") } + +func (f *Forge) PrintReleaseReport() int { + var count int + + log.Info(ReleaseReportHeader()) + + loop := f.Repos.SortByFullPath() + for loop.Scan() { + check := loop.Next() + if f.Config.IsReadOnly(check.GetGoPath()) { + continue + } + if check.GetLastTag() == check.GetTargetVersion() { + continue + } + count += 1 + if check == nil { + log.Info("boo, you didn't git clone", check.GetGoPath()) + continue + } + var state string + if check.CheckDirty() { + state = "(dirty)" + } + log.Info(f.StandardReleaseHeader(check, state)) + } + log.Info(fmt.Sprintf("total repo count = %d", count)) + return count +} -- cgit v1.2.3