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 --always47e1ba1
git describe --tags --dirty --always | cut -c 2- 7e1ba1 -- this is undesirable
This commit is contained in:
parent
4125812a63
commit
465fbba7d1
2
Makefile
2
Makefile
|
@ -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)))
|
||||
|
|
Loading…
Reference in New Issue