From 06dd54fc4e6d723af74fc306c56722247f424de2 Mon Sep 17 00:00:00 2001 From: itchyny Date: Wed, 8 Jan 2020 01:06:42 +0900 Subject: [PATCH] embed git revision --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 18989f7..4d29ff9 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ BIN := mmv VERSION := $$(make -s show-version) VERSION_PATH := cmd/$(BIN) -BUILD_LDFLAGS := "-s -w" +CURRENT_REVISION := $(shell git rev-parse --short HEAD) +BUILD_LDFLAGS := "-s -w -X main.revision=$(CURRENT_REVISION)" GOBIN ?= $(shell go env GOPATH)/bin export GO111MODULE=on