From 2ad76dbca4455bf2fc4612b743e4584f1916db31 Mon Sep 17 00:00:00 2001 From: IdlePhysicist Date: Fri, 5 Jun 2020 18:12:40 +0100 Subject: [PATCH] small (mainly asthetic) patch to Makefile to not show empty commit version info --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 81f57bb..820f575 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ CGO=1 SRC=cmd BUILD=build version?="0.0.0" -commit=`git rev-list -1 HEAD | head -c 8` +commit=`if [ -d ./.git ]; then git rev-list -1 HEAD | head -c 8; else echo "release build"; fi` date=`date "+%Y-%m-%d"` package=main ldflags="-X $(package).commit=$(commit) -X $(package).version=$(version) -X $(package).date=$(date)"