From a8f7adee19c9087bf3434f7d4d6a4d205c7a1a42 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 14 Dec 2024 17:47:30 -0600 Subject: [PATCH] allow junk go.mod & go.sum files --- argv.go | 1 + exit.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/argv.go b/argv.go index 707791e..71ae968 100644 --- a/argv.go +++ b/argv.go @@ -14,6 +14,7 @@ type args struct { Notes bool `arg:"--metadata" help:"save as git metadata (notes)"` Restore bool `arg:"--restore" default:"true" help:"restore from git metadata"` Force bool `arg:"--force" help:"remove the old one"` + Pure bool `arg:"--pure" default:"false" help:"never leave go.* files unless things are perfect"` } func (args) Version() string { diff --git a/exit.go b/exit.go index 4664fda..0f34ce3 100644 --- a/exit.go +++ b/exit.go @@ -18,7 +18,9 @@ func badExit(check *gitpb.Repo, err error) { log.DaemonMode(true) log.Info("go-mod-clean failed: ", err, forge.GetGoSrc()) if check != nil { - eraseGoMod(check) + if argv.Pure { + eraseGoMod(check) + } } os.Exit(-1) }