From 23df03566c293247fb7c8710ed865c29bc1fb538 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 2 Jan 2019 12:01:00 -0800 Subject: [PATCH] build: fix release script to include commit hash In this commit we update the release script to properly include the commit hash in compiled binaries of lnd and lncli. In the future, we should ditch the release script and extend the Makefile to support this use case. Fixes #2389. --- release.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/release.sh b/release.sh index 2dbdac58..6c002efe 100755 --- a/release.sh +++ b/release.sh @@ -27,8 +27,9 @@ SYS=${LNDBUILDSYS:-"windows-386 windows-amd64 openbsd-386 openbsd-amd64 linux-38 # Use the first element of $GOPATH in the case where GOPATH is a list # (something that is totally allowed). -GPATH=$(echo $GOPATH | cut -f1 -d:) -COMMITFLAGS="-X main.Commit=$(git rev-parse HEAD)" +PKG="github.com/lightningnetwork/lnd" +COMMIT=$(git describe --abbrev=40 --dirty) +COMMITFLAGS="-X $PKG/build.Commit=$COMMIT" for i in $SYS; do OS=$(echo $i | cut -f1 -d-)