diff options
| author | Jeff Carr <[email protected]> | 2025-10-16 10:15:01 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-16 10:15:01 -0500 |
| commit | bc50d1090b2b29c55c005821f4e84c8874b9de6e (patch) | |
| tree | 67d7b63657e60a6100a9a87a8b6a441a466f1d3f /doVerify.go | |
| parent | bb4450ec2d02740732dc022b02d9ace6585cb5c6 (diff) | |
try breaking this problem into partsv0.25.91
Diffstat (limited to 'doVerify.go')
| -rw-r--r-- | doVerify.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/doVerify.go b/doVerify.go index 0b07092..5317183 100644 --- a/doVerify.go +++ b/doVerify.go @@ -4,6 +4,7 @@ package main import ( + "errors" "path/filepath" "go.wit.com/lib/gui/prep" @@ -46,7 +47,7 @@ func cleanNamespace(r *gitpb.Repo) string { func doVerifyNamespace() (string, error) { var s string = "doVerifyNamespace()" var err error - var changed bool + var counter int for r := range me.forge.Repos.IterAll() { newpath := cleanNamespace(r) if newpath == "" { @@ -56,18 +57,22 @@ func doVerifyNamespace() (string, error) { // already good namespace. continue } else if newpath != r.Namespace { - changed = true + counter += 1 log.Info("Changed", r.FullPath, "to", newpath) r.Namespace = newpath continue } + counter += 1 log.Info("cleanNamespace() didn't match", r.Namespace) } + if counter != 0 { + err = errors.New(log.Sprintf("%d namespaces were invalid", counter)) + } if prep.DryRun() { return s, err } - if changed { + if counter != 0 { me.forge.Repos.SaveVerbose() } |
