From 40c99e9ef33b6395228ab99088b64571de699a67 Mon Sep 17 00:00:00 2001 From: Vikram Rangnekar Date: Mon, 13 Apr 2020 00:50:54 -0400 Subject: [PATCH] Fix issue with missing build variables --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index fcc72d3..d2f9339 100644 --- a/Makefile +++ b/Makefile @@ -12,10 +12,10 @@ endif export GO111MODULE := on # Build-time Go variables -version = github.com/dosco/super-graph/serv.version -gitBranch = github.com/dosco/super-graph/serv.gitBranch -lastCommitSHA = github.com/dosco/super-graph/serv.lastCommitSHA -lastCommitTime = github.com/dosco/super-graph/serv.lastCommitTime +version = github.com/dosco/super-graph/cmd/internal/serv.version +gitBranch = github.com/dosco/super-graph/cmd/internal/serv.gitBranch +lastCommitSHA = github.com/dosco/super-graph/cmd/internal/serv.lastCommitSHA +lastCommitTime = github.com/dosco/super-graph/cmd/internal/serv.lastCommitTime BUILD_FLAGS ?= -ldflags '-s -w -X ${lastCommitSHA}=${BUILD} -X "${lastCommitTime}=${BUILD_DATE}" -X "${version}=${BUILD_VERSION}" -X ${gitBranch}=${BUILD_BRANCH}' @@ -77,10 +77,10 @@ clean: run: clean @go run $(BUILD_FLAGS) main.go $(ARGS) -install: build - @mv $(BINARY) $(GOPATH)/bin/$(BINARY) +install: clean build @echo "Commit Hash: `git rev-parse HEAD`" @echo "Old Hash: `shasum $(GOPATH)/bin/$(BINARY) 2>/dev/null | cut -c -32`" + @mv $(BINARY) $(GOPATH)/bin/$(BINARY) @echo "New Hash:" `shasum $(GOPATH)/bin/$(BINARY) 2>/dev/null | cut -c -32` uninstall: clean