allow junk go.mod & go.sum files

This commit is contained in:
Jeff Carr 2024-12-14 17:47:30 -06:00
parent 34b61c9123
commit a8f7adee19
2 changed files with 4 additions and 1 deletions

View File

@ -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 {

View File

@ -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)
}