this needs rework

This commit is contained in:
Jeff Carr 2025-01-19 04:31:49 -06:00
parent 3adf184a4a
commit 66dc174bba
2 changed files with 12 additions and 3 deletions

View File

@ -19,6 +19,11 @@ func doStrict(repo *gitpb.Repo) error {
repo.Run([]string{"git", "notes", "remove"})
if err := repo.RepoIgnoresGoMod(); err != nil {
log.Info(repo.GetGoPath(), "git repo does not ignore go.mod. do nothing here", err)
return nil
}
// erase the go.mod and go.sum files
eraseGoMod(repo)

10
main.go
View File

@ -52,6 +52,13 @@ func main() {
okExit(check, "go.mod and go.sum restored from ~/go/pkg/mod/")
}
if argv.Strict {
if err := doStrict(check); err != nil {
badExit(check, err)
}
okExit(check, "go.mod seems clean")
}
if err := doMain(check); err != nil {
badExit(check, err)
}
@ -106,9 +113,6 @@ func saveAsMetadata(repo *gitpb.Repo) error {
}
func doMain(repo *gitpb.Repo) error {
if argv.Strict {
return doStrict(repo)
}
if argv.Force {
err := doForce(repo)
return err