diff options
| author | Jeff Carr <[email protected]> | 2025-01-08 02:39:30 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-08 02:39:30 -0600 |
| commit | 2c71c4a5fec1fd326c748fc67aa693387fc4a4a1 (patch) | |
| tree | d84c264f90ba7e671c96cbfd7c539898355cec1f | |
| parent | 3d94edd024da17de76cc39078d98bc19e5ef7306 (diff) | |
keep working on why this doesn't work anymore
| -rw-r--r-- | doRelease.go | 15 | ||||
| -rw-r--r-- | http.go | 98 | ||||
| -rw-r--r-- | human.go | 56 | ||||
| -rw-r--r-- | prepareRelease.go | 1 |
4 files changed, 16 insertions, 154 deletions
diff --git a/doRelease.go b/doRelease.go index 2485817..0b3c34d 100644 --- a/doRelease.go +++ b/doRelease.go @@ -9,7 +9,6 @@ import ( "time" "go.wit.com/lib/gui/shell" - "go.wit.com/lib/protobuf/forgepb" "go.wit.com/log" ) @@ -178,22 +177,12 @@ func doRelease() bool { badExit(errors.New(msg)) } - me.forge.ConfigSave() - cmd := []string{"forge", "--delete", check.GetGoPath()} - shell.RunRealtime(cmd) - me.forge = forgepb.Init() + time.Sleep(2 * time.Second) // notsure + check.Reload() // run this each time something gets published successfully rePrepareRelease() - /* - // notsure about this anymore - // update the values in the GUI - if repov := me.repos.View.FindByPath(check.GetGoPath()); repov != nil { - repov.NewScan2(check) - } - */ - // attempt to find another repo to release if !doReleaseFindNext() { log.Info("doReleaseFindNext() could not find a new", findCounter) @@ -3,8 +3,11 @@ package main import ( "fmt" "net/http" + "os" + "path/filepath" "strings" + "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" ) @@ -100,13 +103,13 @@ func okHandler(w http.ResponseWriter, r *http.Request) { log.Info("boo, current is missing", me.current.GetGoPath()) return } + testGoRepo(check) me.forge.HumanPrintRepo(check) return case "/list": - me.forge.PrintReleaseReport(me.forge.Repos) + me.forge.PrintHumanTable(me.found) return case "/releaseList": - me.forge.PrintReleaseReport(me.found) me.forge.PrintHumanTable(me.found) return default: @@ -114,28 +117,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) { } } -// starts and sits waiting for HTTP requests -func startHTTP() { - http.HandleFunc("/", okHandler) - - p := fmt.Sprintf(":%d", argv.Port) - log.Println("Running on port", p) - - err := http.ListenAndServe(p, nil) - if err != nil { - log.Println("Error starting server:", err) - } -} - -/* -func testNext() { - // re-scans the go.sum file. DOES NOT MODIFY ANYTHING - check := me.forge.FindByGoPath(me.current.GetGoPath()) - if check == nil { - log.Info("boo, you didn't git clone", me.current.GetGoPath()) - return - } - +func testGoRepo(check *gitpb.Repo) { data, _ := os.ReadFile(filepath.Join(check.FullPath, "go.mod")) log.Info(string(data)) @@ -147,67 +129,15 @@ func testNext() { } -func showNext() { - log.Info("gui repo: " + me.release.repo.String()) - log.Info("gui name: " + me.release.version.String()) - log.Info("gui notes: " + me.release.notes.String()) - log.Info("gui status: " + me.release.status.String()) - log.Info("") - if me.current == nil { - log.Info("me.current == nil") - return - } +// starts and sits waiting for HTTP requests +func startHTTP() { + http.HandleFunc("/", okHandler) - check := me.forge.FindByGoPath(me.current.GetGoPath()) - if check == nil { - log.Info("forge: how was this not found?", me.current.GetGoPath()) - return - } + p := fmt.Sprintf(":%d", argv.Port) + log.Println("Running on port", p) - if me.current.GetTargetVersion() == "" { - log.Info("TargetVersion == blank") - } - if me.current.GetTargetVersion() == me.current.GetCurrentVersion() { - log.Info("IsReleased() == true. do not release this a second time") - } else { - log.Info("IsReleased() == false") - } - if check.CheckDirty() { - log.Info("CheckDirty() == true. do not release dirty repos") - } else { - log.Info("CheckDirty() == false") - } - if check.GetGoPrimitive() { - log.Info("IsPrimitive() == true") - } else { - log.Info("IsPrimitive() == false") - } - if me.forge.Config.IsPrivate(check.GetGoPath()) { - log.Info("IsPrivate() == true") - } else { - log.Info("IsPrivate() == false") - } - if ok, compiled, err := me.current.IsProtobuf(); ok { - log.Info(log.Sprint("IsProtobuf() == true compiled protobuf files = ", compiled)) - if err != nil { - msg := fmt.Sprint("IsProtobuf() == err", err) - badExit(errors.New(msg)) - } - for _, s := range compiled { - log.Info("\tcompiled file found:", s) - } - } else { - log.Info("IsProtobuf() == false") - if err != nil { - log.Info(log.Sprint("IsProtobuf() == err", err)) - } + err := http.ListenAndServe(p, nil) + if err != nil { + log.Println("Error starting server:", err) } - - testNext() - - log.Info(repolist.ReportHeader()) - log.Info("") - log.Info(repolist.ReleaseReportHeader()) - log.Info(me.forge.StandardReleaseHeader(me.current, "notsure")) } -*/ diff --git a/human.go b/human.go deleted file mode 100644 index a615c0f..0000000 --- a/human.go +++ /dev/null @@ -1,56 +0,0 @@ -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 me.forge.Config.IsReadOnly(repo.GetGoPath()) { - 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.FindByGoPath(repo.GetGoPath()) - if check == nil { - log.Info("boo, you didn't git clone", repo.GetGoPath()) - continue - } - me.forge.StandardReleaseHeader(check, repo.State()) - } - log.Info(fmt.Sprintf("EVERYTHING WORKED repo count = %d", count)) -} diff --git a/prepareRelease.go b/prepareRelease.go index a2ca20c..e85a660 100644 --- a/prepareRelease.go +++ b/prepareRelease.go @@ -129,5 +129,4 @@ func rePrepareRelease() { } } - me.forge.ConfigSave() } |
