summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-28 22:01:32 -0600
committerJeff Carr <[email protected]>2024-02-28 22:01:32 -0600
commit2c1cd3343bfc0d3c032965da9eed62ea511bb3b8 (patch)
treedba7bc1215dd850ca2f59f6999c91c1ef44cdf66
parente825cffc8a42aa932b7e80cbaa8e8e679446c671 (diff)
make the version an ldflag
-rw-r--r--Makefile6
-rw-r--r--main.go4
2 files changed, 7 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 11a52f9..5c74f72 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+VERSION = $(shell git describe --tags)
+
all: build
./guireleaser
@@ -14,7 +16,8 @@ build:
echo "build it!"
-rm resources/*.so
cp -a ~/go/src/go.wit.com/toolkits/*.so resources/
- GO111MODULE=off go build -v -x
+ GO111MODULE=off go build -v -x -ldflags " \
+ -X main.VERSION=${VERSION}"
install:
rm -f ~/go/src/go.wit.com/toolkits/*.so
@@ -28,4 +31,3 @@ redomod:
rm -f go.*
GO111MODULE= go mod init
GO111MODULE= go mod tidy
-
diff --git a/main.go b/main.go
index 5cc270d..fd1d091 100644
--- a/main.go
+++ b/main.go
@@ -10,6 +10,8 @@ import (
"go.wit.com/log"
)
+var VERSION string
+
// TODO: autocompute these in the gui
var releaseReasonS string
var releaseVersion string
@@ -41,7 +43,7 @@ func main() {
me.myGui.Default()
// our main window
- me.mainWindow = me.myGui.NewWindow("GUI release manager")
+ me.mainWindow = me.myGui.NewWindow("GUI release manager " + VERSION)
me.mainBox = me.mainWindow.NewBox("bw hbox", true)
// sanity check of things that might be around that mess