guireleaser/human.go

86 lines
1.7 KiB
Go
Raw Normal View History

package main
import (
"fmt"
"go.wit.com/lib/gui/repolist"
"go.wit.com/log"
)
func PrintReport(readonly string, onlydirty string, perfect string) {
var count int
log.Info(repolist.ReportHeader())
loop := me.repos.View.ReposSortByName()
for loop.Scan() {
repo := loop.Repo()
count += 1
header := repo.StandardHeader()
if onlydirty == "true" {
if repo.CheckDirty() {
log.Info(header + "")
}
continue
}
2024-12-03 13:23:55 -06:00
if me.forge.Config.IsReadOnly(repo.GoPath()) {
if readonly == "true" {
log.Info(header + "readonly")
}
continue
}
if repo.State() == "PERFECT" {
if perfect == "false" {
continue
}
}
if repo.State() != "merge to main" {
log.Info(header + "")
continue
}
if repo.CheckDirty() {
log.Info(header + "")
continue
}
log.Info(header + "")
check := me.forge.Repos.FindByGoPath(repo.GoPath())
if check == nil {
log.Info("boo, you didn't git clone", repo.GoPath())
continue
}
me.forge.StandardReleaseHeader(check, repo.State())
}
log.Info(fmt.Sprintf("EVERYTHING WORKED repo count = %d", count))
}
2024-12-13 20:32:07 -06:00
func PrintReleaseReport(readonly string, perfect string) int {
var count int
log.Info(repolist.ReleaseReportHeader())
2024-12-03 13:23:55 -06:00
loop := me.forge.Repos.SortByGoPath()
for loop.Scan() {
2024-12-03 13:23:55 -06:00
check := loop.Next()
2024-12-05 12:49:07 -06:00
if me.forge.Config.IsReadOnly(check.GoPath) {
continue
}
2024-12-03 13:23:55 -06:00
if check.GetCurrentBranchVersion() == check.GetTargetVersion() {
continue
}
count += 1
if check == nil {
2024-12-03 13:23:55 -06:00
log.Info("boo, you didn't git clone", check.GoPath)
continue
}
2024-12-03 18:00:42 -06:00
var state string
if check.CheckDirty() {
state = "(dirty)"
}
log.Info(me.forge.StandardReleaseHeader(check, state))
}
log.Info(fmt.Sprintf("total repo count = %d", count))
2024-12-13 20:32:07 -06:00
return count
}