diff options
Diffstat (limited to 'findNext.go')
| -rw-r--r-- | findNext.go | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/findNext.go b/findNext.go index dbacc00..e78aeb3 100644 --- a/findNext.go +++ b/findNext.go @@ -101,25 +101,26 @@ func findNext() bool { func fixGodeps(check *gitpb.Repo) bool { var good bool = true // check if the package dependancies changed, if so, re-publish + cmd := []string{"go-clean", "--auto"} + result := check.RunRealtime(cmd) + if result.Error != nil { + log.Info(cmd, "failed with", result.Error, check.GoPath) + return false + } + if result.Exit != 0 { + log.Info(cmd, "failed with", result.Exit, check.GoPath) + return false + } + check.GoDeps = nil // skip primative ones if ok, _ := check.IsPrimitive(); ok { log.Info("fixGoDeps() skipping primitive", check.GoPath) return true } - ok, err := check.RedoGoMod() - if err != nil { - log.Info("fixGoDeps() RedoGoMod() error", err) - return false - } - if !ok { - log.Info("gitpb.RedoGoMod() returned false", check.GetGoPath()) + if ok, err := check.ParseGoSum(); !ok { + log.Info("ParseGoSum() failed", err) return false } - if check.GoDeps == nil { - cmd := []string{"go", "mod", "edit", "-go=1.20"} - check.Run(cmd) - return true - } log.Printf("current repo %s go dependancy count: %d", check.GetGoPath(), check.GoDepsLen()) deps := check.GoDeps.SortByGoPath() for deps.Scan() { @@ -143,15 +144,6 @@ func fixGodeps(check *gitpb.Repo) bool { check.Run(cmd) } } - cmd := []string{"go", "mod", "tidy"} - check.Run(cmd) - cmd = []string{"go", "mod", "edit", "-go=1.20"} - check.Run(cmd) - check.GoDeps = nil - if ok, err := check.ParseGoSum(); !ok { - log.Info("ParseGoSum() failed", err) - return false - } return good } |
