Add some more information to -version flag

This commit is contained in:
Zachary Yedidia
2016-08-27 20:03:43 -04:00
parent 2de42bcf99
commit 1260dcc5ee
3 changed files with 16 additions and 8 deletions

View File

@@ -1,9 +1,10 @@
.PHONY: runtime
VERSION = "$(shell git rev-parse --short HEAD)"
VERSION = $(shell git describe --tags --abbrev=0)
HASH = $(shell git rev-parse --short HEAD)
build: tcell
go build -ldflags "-X main.Version=$(VERSION)" -o micro ./cmd/micro
go build -ldflags "-X main.Version=$(VERSION) -X main.CommitHash=$(HASH) -X 'main.CompileDate=$(shell date -u '+%B %d, %Y')'" -o micro ./cmd/micro
install: build
mv micro $(GOPATH)/bin