added version to cli

This commit is contained in:
Manuel Carmona
2017-07-07 11:20:54 +02:00
parent d3f79d9a37
commit 4edff792e8
3 changed files with 26 additions and 2 deletions

View File

@ -4,6 +4,11 @@ COVERAGE_MODE := atomic
LINGUIST_PATH = .linguist
# build CLI
VERSION := $(shell git describe --tags --abbrev=0)
COMMIT := $(shell git rev-parse --short HEAD)
LDFLAGS = -s -X main.Version=$(VERSION) -X main.GitHash=$(COMMIT)
$(LINGUIST_PATH):
git clone https://github.com/github/linguist.git $@
@ -29,3 +34,6 @@ code-generate: $(LINGUIST_PATH)
clean:
rm -rf $(LINGUIST_PATH)
build-cli:
go build -o enry -ldflags "$(LDFLAGS)" cli/enry/main.go