Add 'version' command

This commit is contained in:
2021-05-16 18:38:33 +02:00
parent c206b07b2d
commit 216e59747c
2 changed files with 11 additions and 0 deletions

6
Makefile Normal file
View File

@@ -0,0 +1,6 @@
GIT_COMMIT=$(shell git rev-list -1 HEAD)
GIT_TAG=$(shell git tag --sort="-version:refname" | head -n 1)
all:
go build -ldflags "-X main.GitCommit=${GIT_COMMIT} -X main.GitTag=${GIT_TAG}"