summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-15 22:39:54 -0600
committerJeff Carr <[email protected]>2024-12-15 22:39:54 -0600
commit849378a95f334017f86f1675d35306f6fcc3e3bf (patch)
tree72c67e97c8b30d0d931ad7a7a4ad007ee463232a
parent3b714282df43c050920c16a47ee7b8ea46f4c350 (diff)
hopefully this works betterv0.0.15v0.0.14v0.0.13
-rw-r--r--main.go27
1 files changed, 19 insertions, 8 deletions
diff --git a/main.go b/main.go
index 6336d3d..d777042 100644
--- a/main.go
+++ b/main.go
@@ -37,14 +37,8 @@ func main() {
all := forge.Repos.SortByGoPath()
for all.Scan() {
check = all.Next()
- if argv.Force {
- if err := doForce(check); err != nil {
- // badExit(check, err)
- }
- } else {
- if err := doSmart(check); err != nil {
- // badExit(check, err)
- }
+ if err := doMain(check); err != nil {
+ badExit(check, err)
}
}
} else {
@@ -55,6 +49,9 @@ func main() {
badExit(nil, nil)
}
+ if err := doMain(check); err != nil {
+ badExit(check, err)
+ }
if argv.Force {
if err := doForce(check); err != nil {
badExit(check, err)
@@ -140,3 +137,17 @@ func restoreFromGoPkg(repo *gitpb.Repo) error {
// try go.sum, but no error checking since it might not be there
return nil
}
+
+func doMain(repo *gitpb.Repo) error {
+ if argv.Strict {
+ return doStrict(repo)
+ }
+ if argv.Force {
+ err := doForce(repo)
+ return err
+ }
+
+ // if --force or --strict is not set, fall back to a "smart" guess
+ // at what the user probably would want
+ return doSmart(repo)
+}