From c79cdb30076a2a9a5093409886db8913f224c230 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 5 Nov 2024 04:46:59 -0600 Subject: generates the go.wit.com file easily Signed-off-by: Jeff Carr --- http.go | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) (limited to 'http.go') diff --git a/http.go b/http.go index a99e6a2..8622c83 100644 --- a/http.go +++ b/http.go @@ -6,6 +6,7 @@ import ( "os" "strings" + "go.wit.com/lib/gui/repolist" "go.wit.com/log" ) @@ -82,6 +83,8 @@ func okHandler(w http.ResponseWriter, r *http.Request) { msg(w, me.current.StandardHeader()) msg(w, me.current.StandardReleaseHeader()) + case "/rescanAll": + me.repos.View.ScanRepositories() case "/setCurrentRepo": msg(w, "repo: "+repoName) @@ -158,16 +161,39 @@ func okHandler(w http.ResponseWriter, r *http.Request) { if checkValidGoSum(me.current) { msg(w, "checkValidGoSum() == true") } else { - msg(w, "checkValidGoSum() == false") + msg(w, "checkValidGoSum() == false SHOULD NOT RELEASE THIS") } if me.current.Status.IsReleased() { - msg(w, "IsReleased() == true") + msg(w, "IsReleased() == true SHOULD NOT RELEASE THIS") } else { msg(w, "IsReleased() == false") } + if me.current.Status.CheckDirty() { + msg(w, "CheckDirty() == true. SHOULD NOT RELEASE THIS") + } else { + msg(w, "CheckDirty() == false") + } + if me.current.Status.IsPrimitive() { + msg(w, "IsPrimitive() == true") + } else { + msg(w, "IsPrimitive() == false") + } + if me.current.Status.IsProtobuf() { + msg(w, "IsProtobuf() == true") + } else { + msg(w, "IsProtobuf() == false") + } + if me.current.Status.Whitelist { + msg(w, "Whitelist == true SHOULD NOT RELEASE THIS") + } else { + msg(w, "Whitelist == false") + } msg(w, "") + msg(w, repolist.ReportHeader()) msg(w, me.current.StandardHeader()) + msg(w, "") + msg(w, repolist.ReleaseReportHeader()) msg(w, me.current.StandardReleaseHeader()) case "/list": me.repos.View.PrintReport(w, readonly, onlydirty, perfect) @@ -176,6 +202,35 @@ func okHandler(w http.ResponseWriter, r *http.Request) { case "/quit": msg(w, "Got URL /quit") os.Exit(0) + case "/goweblist": + loop := me.repos.View.ReposAll() + for loop.Scan() { + repo := loop.Repo() + + lastTag := repo.LastTag() + tag := repo.Status.NewestTag() + gitAge, err := tag.GetDate() + if err != nil { + msg(w, fmt.Sprintf("tag date error", repo.Name())) + } + // if lastTag == "" { + // lastTag = tag.Name() + // } + if repo.ReadOnly() { + if readonly == "true" { + continue + } + } + // dur := time.Since(gitAge) + // msg(w, fmt.Sprintf("%-60s %s %s %s", repo.Name(), lastTag, shell.FormatDuration(dur), lastTag, tag.Name())) + msg(w, fmt.Sprintf("%s %d %s", repo.Name(), gitAge.Unix(), lastTag)) + /* + for _, tag := range repo.Tags.ListAll() { + msg(w, fmt.Sprintf("%-60s %s", "", tag.Name())) + } + */ + + } default: msg(w, "BAD URL = "+route) } -- cgit v1.2.3