From 20b3fa352078071aa5ef3fcaa58f120bbe331fa1 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 10 Dec 2024 01:47:45 -0600 Subject: [PATCH] testing automation --- Makefile | 4 ++-- releaseBox.go | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1dba7ad..9d9b9bf 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION = $(shell git describe --tags) BUILDTIME = $(shell date +%Y.%m.%d) -all: build +all: goimports build goimports: goimports -w *.go @@ -19,7 +19,7 @@ build: GO111MODULE=off go build \ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" -install: +install: goimports -rm resources/*.so cp -a ~/go/src/go.wit.com/toolkits/*/*.so resources/ GO111MODULE=off go install \ diff --git a/releaseBox.go b/releaseBox.go index 4020207..5da083f 100644 --- a/releaseBox.go +++ b/releaseBox.go @@ -154,6 +154,33 @@ func createReleaseBox(box *gui.Node) { } second := findCounter log.Info("doReleaseAll() first =", first, "second =", second) + if first == 0 { + log.Info("doReleaseAll() first is 0. everything is done") + log.Info("os.Exit(0) here safely") + buttonEnable() + return + } + + if first != second { + log.Info("doReleaseAll() first second do not match. findNext()") + findNext() + ok, duration := doReleaseAll() + s := fmt.Sprint(duration) + log.Info("release returned", ok, "and ran for", s, "findCounter =", findCounter) + third := findCounter + log.Info("doReleaseAll() first =", first, "second =", second, "third =", third) + } else { + log.Info("doReleaseAll() first second match. something has gone terribly wrong") + log.Info("killing guireleaser is a bad idea here. it will potentially loose state") + log.Info("the only way now is to parse 'go list' or ~/go/pkg/mod//go.sum files") + log.Info("to determine the last known version to make sure everything is redone correctly") + log.Info("this is the worst case. the better idea is to make sure it never fails") + log.Info("and restarts correctly where it left off. That might not be possible?") + log.Info("because 'go get @foo.com/bar@latest' appears to be global and so") + log.Info("some go.sum files might be correct when some are not actually published") + log.Info("TODO: is this true or not?") + } + buttonEnable() }) grid.NextRow()