summaryrefslogtreecommitdiff
path: root/findNext.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-12 02:05:47 -0600
committerJeff Carr <[email protected]>2024-12-12 02:05:47 -0600
commit6e9ff62fbaa25ce9d3375cb1049989f53de27e16 (patch)
treecbf853f4e71e8c0cd35fb35b5eab1e8ed7d8805c /findNext.go
parent2d981da765c0de80070fc776b2054034b9e2a8e4 (diff)
keep switching to protobuf
Diffstat (limited to 'findNext.go')
-rw-r--r--findNext.go34
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
}