Add -v / --version command and appropriate build flags.

This commit is contained in:
2021-05-09 11:40:36 +01:00
parent 8bbde1f600
commit cbe73e16db
5 changed files with 22 additions and 4 deletions
+3 -1
View File
@@ -1,7 +1,9 @@
LOCAL_VERSION?=$(shell semver-gen generate -l -c config-release.yaml | sed -e 's|SEMVER ||g')
all: build
build:
@go build -o semver-gen *.go
go build -o semver-gen -ldflags="-s -w -X main.PKG_VERSION=${LOCAL_VERSION}" *.go
run: build
@./semver-gen