this needs rework
This commit is contained in:
parent
3adf184a4a
commit
66dc174bba
|
@ -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
10
main.go
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue