diff options
| author | Jeff Carr <[email protected]> | 2024-12-18 20:08:48 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-18 20:08:48 -0600 |
| commit | 35fdbe31508f9afdce044fe9c918b5b22756fa8f (patch) | |
| tree | a627da27a30df04dbbd5f2d23236b365c912c7a7 /findNext.go | |
| parent | 54c70eb166a26a92bdcac3fe4eadda86543042ac (diff) | |
go.work files should be git metadata
Diffstat (limited to 'findNext.go')
| -rw-r--r-- | findNext.go | 43 |
1 files changed, 8 insertions, 35 deletions
diff --git a/findNext.go b/findNext.go index bb11064..9b4f3be 100644 --- a/findNext.go +++ b/findNext.go @@ -50,40 +50,13 @@ func findNext() bool { } findCounter += 1 - if check.Exists("go.mod") { - log.Info("go.mod exists here") - } else { - log.Info("go.mod is gone here") - } - if ok, err := check.ParseGoSum(); !ok { - log.Info("ParseGoSum() failed (probably repo needs go mod tidy)", err) - log.Info("ParseGoSum() findFix =", findFix, "findCounter =", findCounter) - if check.Exists("go.mod") { - log.Info("go.mod exists here") - } else { - log.Info("go.mod is gone here") - } + if !check.ParseGoSum() { continue } - if check.Exists("go.mod") { - log.Info("go.mod exists here") - } else { - log.Info("go.mod is gone here") - } if me.forge.FinalGoDepsCheckOk(check) { setCurrentRepo(check, "should be good to release", "pretty sure") - if check.Exists("go.mod") { - log.Info("go.mod exists here") - } else { - log.Info("go.mod is gone here") - } return true } - if check.Exists("go.mod") { - log.Info("go.mod exists here") - } else { - log.Info("go.mod is gone here") - } log.Info("findNext() got to the end. repo", check.GetGoPath(), "did not work. trying to find a new one now") } if findCounter == 0 { @@ -97,11 +70,11 @@ func findNext() bool { return false } -func runGoClean(check *gitpb.Repo) bool { +func runGoClean(check *gitpb.Repo, myarg string) bool { // check if the package dependancies changed, if so, re-publish check.GoDeps = nil - cmd := []string{"go-mod-clean", "--strict"} + cmd := []string{"go-mod-clean", myarg} log.Info("Running", cmd, "in", check.GetGoPath()) result := check.Run(cmd) if result.Error != nil { @@ -120,17 +93,17 @@ func runGoClean(check *gitpb.Repo) bool { log.Info(strings.Join(result.Stderr, "\n")) return false } - if ok, err := check.ParseGoSum(); !ok { - log.Info("ParseGoSum() failed", err) - return false + if check.ParseGoSum() { + return true } - return true + log.Info("ParseGoSum() failed") + return false } // tries to fix the go.mod and go.sum files func fixGodeps(check *gitpb.Repo) bool { var good bool = true - if !runGoClean(check) { + if !runGoClean(check, "--strict") { return false } // skip primative ones |
