Somewhat better version handling

This commit is contained in:
Imbus 2025-01-28 11:40:56 +01:00
parent e7596e41f7
commit f5de8d1f37
5 changed files with 19 additions and 12 deletions

View file

@ -1,7 +1,10 @@
NAME = rexclient
VERSION_FILE := ../VERSION.txt
REX_VERSION ?= $(shell cat $(VERSION_FILE))
build: commit.txt
go build -tags no_emoji -trimpath -ldflags="-s -w" -buildvcs=false -o $(NAME)
go build -tags no_emoji -trimpath -ldflags="-s -w -X main.rex_version=$(REX_VERSION)" -buildvcs=false -o $(NAME)
run: commit.txt
go run .

View file

@ -15,13 +15,11 @@ import (
model "rex_model"
)
//go:generate sh -c "printf %s $(git rev-parse --short HEAD) > commit.txt"
//go:embed commit.txt
var git_rev string
var rex_version = "UNDEFINED"
func main() {
a := app.New()
w := a.NewWindow(fmt.Sprintf("RexForge %s", strings.ToUpper(git_rev)))
w := a.NewWindow(fmt.Sprintf("RexForge %s", strings.ToUpper(rex_version)))
w.Resize(fyne.NewSize(900, 600))
addons := model.AddonIndex