summaryrefslogtreecommitdiff
path: root/human.go
diff options
context:
space:
mode:
Diffstat (limited to 'human.go')
-rw-r--r--human.go87
1 files changed, 87 insertions, 0 deletions
diff --git a/human.go b/human.go
new file mode 100644
index 0000000..c204aed
--- /dev/null
+++ b/human.go
@@ -0,0 +1,87 @@
+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
+ }
+
+ if repo.ReadOnly() {
+ 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))
+}
+
+func PrintReleaseReport(readonly string, perfect string) {
+ var count int
+
+ log.Info(repolist.ReleaseReportHeader())
+
+ loop := me.repos.View.ReposSortByName()
+ for loop.Scan() {
+ repo := loop.Repo()
+
+ if repo.ReadOnly() && (readonly == "true") {
+ continue
+ }
+ if (repo.State() == "PERFECT") && (perfect == "true") {
+ continue
+ }
+ if repo.Status.IsReleased() {
+ continue
+ }
+ count += 1
+ header := repo.StandardReleaseHeader()
+ log.Info(header)
+ check := me.forge.Repos.FindByGoPath(repo.GoPath())
+ if check == nil {
+ log.Info("boo, you didn't git clone", repo.GoPath())
+ continue
+ }
+ log.Info(me.forge.StandardReleaseHeader(check, repo.State()))
+ }
+ log.Info(fmt.Sprintf("total repo count = %d", count))
+}