summaryrefslogtreecommitdiff
path: root/doRelease.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-13 20:32:07 -0600
committerJeff Carr <[email protected]>2024-12-13 20:32:07 -0600
commit1c8f55d397acb6b653d83f050d15329d7de33bfd (patch)
treeebf6830cf93235c2eda427a90c09aae9fdf60c9b /doRelease.go
parentd1708d6a4bea44c9935e0b26e7d3e3a209c3b4b1 (diff)
move checks to panic in safer placesv0.22.36
Diffstat (limited to 'doRelease.go')
-rw-r--r--doRelease.go28
1 files changed, 18 insertions, 10 deletions
diff --git a/doRelease.go b/doRelease.go
index 6713259..ddf25dd 100644
--- a/doRelease.go
+++ b/doRelease.go
@@ -55,6 +55,19 @@ func doRelease() bool {
os.Exit(-1)
return false
}
+ if check.GoPath == me.startRepo.GoPath {
+ log.Info("CAN NOT SELF UPDATE.", check.GoPath, "is the same as os.Getwd()")
+ log.Info("go get must be run from somewhere else other than startRepo")
+ log.Info("chdir to autotypist if it exists")
+ os.Exit(-1)
+ }
+ if !me.startRepo.Exists("go.mod") {
+ log.Info("go.sum missing in", me.startRepo.GoPath)
+ log.Info("pick a different repo here")
+ log.Info("todo: error out earlier knowing this will upgrade")
+ log.Info("versions", me.startRepo.GetTargetVersion(), me.startRepo.GetMasterVersion())
+ panic("redo go.sum")
+ }
log.Info("\ttag and push", curName, me.release.version.String(), me.releaseReasonS)
@@ -180,8 +193,10 @@ func doRelease() bool {
// attempt to find another repo to release
if !doReleaseFindNext() {
- log.Info("doReleaseFindNext() could not find a new")
- log.Info("THIS PROBABLY MEANS THAT ACTUALLY WE ARE TOTALLY DONE?")
+ log.Info("doReleaseFindNext() could not find a new", findCounter)
+ log.Info("THIS PROBABLY MEANS THAT ACTUALLY WE ARE TOTALLY DONE?", findCounter)
+ count := PrintReleaseReport("", "")
+ log.Info("count =", count)
os.Setenv("FindNextDone", "true")
return false
}
@@ -226,13 +241,6 @@ func doPublishVersion() bool {
docmd := []string{"go", "get", "-v", gopath + "@" + me.release.version.String()}
log.Info("SHOULD RUN cmd HERE:", docmd)
- if !me.startRepo.Exists("go.mod") {
- log.Info("go.sum missing in", me.startRepo.GoPath)
- log.Info("pick a different repo here")
- log.Info("todo: error out earlier knowing this will upgrade")
- log.Info("versions", me.startRepo.GetTargetVersion(), me.startRepo.GetMasterVersion())
- panic("redo go.sum")
- }
if me.current.Status.IsPrivate() {
// do not self update private repos
log.Info("This is a private repo and can not be self checked")
@@ -243,7 +251,7 @@ func doPublishVersion() bool {
var result cmd.Status
if gopath == me.startRepo.GoPath {
log.Info("CAN NOT SELF UPDATE. cmd =", docmd)
- log.Info("go get must be run from somewhere else other than guireleaser")
+ log.Info("go get must be run from somewhere else other than startRepo")
log.Info("chdir to autotypist if it exists")
os.Exit(-1)
}