Fix build to correctly inject version

This commit is contained in:
James Mills 2023-03-26 13:49:09 +10:00
parent f421e30ba8
commit 2dd66671f7
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6
1 changed files with 6 additions and 6 deletions

View File

@ -38,16 +38,16 @@ ifeq ($(DEBUG), 1)
@echo "Building in debug mode..." @echo "Building in debug mode..."
@$(GOCMD) build -tags "netgo static_build" -installsuffix netgo \ @$(GOCMD) build -tags "netgo static_build" -installsuffix netgo \
-ldflags "\ -ldflags "\
-X $(shell go list).Version=$(VERSION) \ -X main.Version=$(VERSION) \
-X $(shell go list).Commit=$(COMMIT) \ -X main.Commit=$(COMMIT) \
-X $(shell go list).Build=$(BUILD)" \ -X main.Build=$(BUILD)" \
. .
else else
@$(GOCMD) build -tags "netgo static_build" -installsuffix netgo \ @$(GOCMD) build -tags "netgo static_build" -installsuffix netgo \
-ldflags "-w \ -ldflags "-w \
-X $(shell go list).Version=$(VERSION) \ -X main.Version=$(VERSION) \
-X $(shell go list).Commit=$(COMMIT) \ -X main.Commit=$(COMMIT) \
-X $(shell go list).Build=$(BUILD)" \ -X main.Build=$(BUILD)" \
. .
endif endif