Merge pull request #92 from github/git-describe

Fix injecting git version information into development build
This commit is contained in:
Corey Johnson 2019-11-22 14:17:02 -08:00 committed by GitHub
commit 267262c882

View file

@ -1,7 +1,7 @@
BUILD_FILES = $(shell go list -f '{{range .GoFiles}}{{$$.Dir}}/{{.}}\
{{end}}' ./...)
GH_VERSION = $(shell go describe --tags 2>/dev/null || git rev-parse --short HEAD)
GH_VERSION = $(shell git describe --tags 2>/dev/null || git rev-parse --short HEAD)
LDFLAGS := -X github.com/github/gh-cli/command.Version=$(GH_VERSION) $(LDFLAGS)
LDFLAGS := -X github.com/github/gh-cli/command.BuildDate=$(shell date +%Y-%m-%d) $(LDFLAGS)
ifdef GH_OAUTH_CLIENT_SECRET