From 999921f8e4e8e14f9df3e1ae24a636c2d220bbd9 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Mon, 26 Jun 2017 21:18:44 +0200 Subject: [PATCH] Use a proper fallback when `git describe` fails --- src/posix.mak | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/posix.mak b/src/posix.mak index bc300f3daddc..c85791cd7741 100644 --- a/src/posix.mak +++ b/src/posix.mak @@ -470,10 +470,7 @@ $G/idgen: $D/idgen.d $(HOST_DMD_PATH) VERSION := $(shell cat ../VERSION) # default to checked-in VERSION file ifneq (1,$(RELEASE)) # unless building a release - VERSION_GIT := $(shell printf "`$(GIT) describe --dirty`") # use git describe - ifneq (,$(VERSION_GIT)) # check for git failures - VERSION := $(VERSION_GIT) - endif + VERSION := $(shell printf "`$(GIT) describe --dirty || cat ../VERSION`") # use git describe endif # only update $G/VERSION when it differs to avoid unnecessary rebuilds