make: get btcd commit hash from go.mod

Since go.sum also contains historical commits, we must fetch currenct
commit hash from go.mod.
This commit is contained in:
Johan T. Halseth 2018-12-04 13:50:46 +01:00
parent 640fe2558b
commit bafc44c14b
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

View File

@ -15,7 +15,7 @@ BTCD_DIR :=${GOPATH}/src/$(BTCD_PKG)
COMMIT := $(shell git describe --abbrev=40 --dirty)
LDFLAGS := -ldflags "-X $(PKG)/build.Commit=$(COMMIT)"
BTCD_COMMIT := $(shell cat go.sum | \
BTCD_COMMIT := $(shell cat go.mod | \
grep $(BTCD_PKG) | \
tail -n1 | \
awk -F " " '{ print $$2 }' | \