cmd/dlv: bugfix: make version command actually print revision number (#926)

This commit is contained in:
Alessandro Arzilli
2017-07-20 20:55:32 +02:00
committed by Derek Parker
parent 135330cbb2
commit 0cea7ccc23
2 changed files with 7 additions and 2 deletions

View File

@ -2,10 +2,13 @@
UNAME=$(shell uname)
PREFIX=github.com/derekparker/delve
GOVERSION=$(shell go version)
BUILD_SHA=$(shell git rev-parse HEAD)
LLDB_SERVER=$(shell which lldb-server)
ifeq "$(UNAME)" "Darwin"
BUILD_FLAGS=-ldflags="-s"
BUILD_FLAGS=-ldflags="-s -X main.Build=$(BUILD_SHA)"
else
BUILD_FLAGS=-ldflags="-X main.Build=$(BUILD_SHA)"
endif
# Workaround for GO15VENDOREXPERIMENT bug (https://github.com/golang/go/issues/11659)

View File

@ -9,6 +9,8 @@ import (
var Build string
func main() {
if Build != "" {
version.DelveVersion.Build = Build
}
cmds.New(false).Execute()
}