diff --git a/prepareRelease.go b/prepareRelease.go index e145a13..469fa3e 100644 --- a/prepareRelease.go +++ b/prepareRelease.go @@ -1,6 +1,9 @@ package main import ( + "os" + "strings" + "go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" @@ -36,10 +39,21 @@ func forceReleaseVersion(repo *gitpb.Repo) { repo.IncrementTargetMinor() } else { // if v1.2.3 change to v.1.2.4 - repo.IncrementTargetRevision() + if repo.IncrementTargetRevision() { + // worked ok + } else { + log.Info("Failed to increment target revision", repo.GetFullPath()) + os.Exit(-1) + } } // empty git notes - repo.Run([]string{"git", "notes", "remove"}) + if result, err := repo.RunStrictNew([]string{"go-mod-clean", "--purge"}); err != nil { + log.Info("probably you don't have go-mod-clean") + log.Info(strings.Join(result.Stdout, "\n")) + log.Info(strings.Join(result.Stderr, "\n")) + repo.Run([]string{"git", "notes", "remove"}) + os.Exit(-1) + } if !runGoClean(repo, "--restore") { log.Info("go-mod-clean probably failed here. that's ok", repo.GetGoPath())