Makefile: get proper git hash when directly on tag + dirty
When the current `HEAD` is tagged, and the work directory is 'dirty', the `GITHASH` variable now contains the actual Git hash. Before this change it would only be the word "dirty".
This commit is contained in:
parent
100e8e404e
commit
b2c49492f1
3
Makefile
3
Makefile
@ -18,6 +18,9 @@ _GIT_DESCRIPTION_OR_TAG := $(subst v${VERSION}-,,$(shell git describe --tag --di
|
||||
# in the "extended version" of Flamenco, which combines ${VERSION} and
|
||||
# ${GITHASH}.
|
||||
GITHASH := $(subst v${VERSION},$(shell git rev-parse --short=9 HEAD),${_GIT_DESCRIPTION_OR_TAG})
|
||||
ifeq (${GITHASH},dirty)
|
||||
GITHASH := $(shell git rev-parse --short=9 HEAD)
|
||||
endif
|
||||
|
||||
LDFLAGS := ${LDFLAGS} -X ${PKG}/internal/appinfo.ApplicationVersion=${VERSION} \
|
||||
-X ${PKG}/internal/appinfo.ApplicationGitHash=${GITHASH} \
|
||||
|
Loading…
x
Reference in New Issue
Block a user