Handle tagless versions (#606)

Average case:
git describe --tags
v0.2.9-130-g47e1ba1
git describe --tags --dirty --always | cut -c 2-
0.2.9-130-g47e1ba1
git describe --tags --dirty --always | sed -e s/^v//
47e1ba1

Edge case (no tags):
git describe --tags --dirty --always
47e1ba1
git describe --tags --dirty --always | cut -c 2-
7e1ba1
-- this is undesirable
This commit is contained in:
Josh Soref 2021-04-05 11:53:06 -04:00 committed by GitHub
parent 4125812a63
commit 465fbba7d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1,5 +1,5 @@
PREFIX ?= /usr/local
VERSION ?= $(shell git describe --tags --dirty --always | cut -c 2-)
VERSION ?= $(shell git describe --tags --dirty --always | sed -e 's/^v//')
IS_SNAPSHOT = $(if $(findstring -, $(VERSION)),true,false)
MAJOR_VERSION = $(word 1, $(subst ., ,$(VERSION)))
MINOR_VERSION = $(word 2, $(subst ., ,$(VERSION)))