From 3ed71a7d2ace5ba464ed03f6b27888661eee6e34 Mon Sep 17 00:00:00 2001 From: Leon Zhang Date: Wed, 13 Jan 2021 19:09:13 +0800 Subject: [PATCH] bug fix git dirty always 1 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 782b414..ee9793c 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ VERSION_TAG := $(shell git describe --tags --always) VERSION_VERSION := $(shell git log --date=iso --pretty=format:"%cd" -1) $(VERSION_TAG) VERSION_COMPILE := $(shell date +"%F %T %z") by $(shell go version) VERSION_BRANCH := $(shell git rev-parse --abbrev-ref HEAD) -VERSION_GIT_DIRTY := $(shell git diff --no-ext-diff 2>/dev/null | wc -l | awk '{print 1}') +VERSION_GIT_DIRTY := $(shell git diff --no-ext-diff 2>/dev/null | wc -l | awk '{print $1}') VERSION_DEV_PATH:= $(shell pwd) LDFLAGS=-ldflags="-s -w -X 'github.com/XiaoMi/soar/common.Version=$(VERSION_VERSION)' -X 'github.com/XiaoMi/soar/common.Compile=$(VERSION_COMPILE)' -X 'github.com/XiaoMi/soar/common.Branch=$(VERSION_BRANCH)' -X github.com/XiaoMi/soar/common.GitDirty=$(VERSION_GIT_DIRTY) -X github.com/XiaoMi/soar/common.DevPath=$(VERSION_DEV_PATH)" -- GitLab