mirror of
https://github.com/EnumeratedDev/enit.git
synced 2026-09-16 02:26:11 +00:00
other: update version setting using git
This commit is contained in:
@@ -7,19 +7,7 @@ LOCALSTATEDIR ?= $(PREFIX)/var
|
||||
RUNSTATEDIR ?= $(LOCALSTATEDIR)/run
|
||||
GO ?= $(shell type -a -P go | head -n 1)
|
||||
|
||||
# Set version variable
|
||||
ifeq ($(VERSION),)
|
||||
COMMIT := $(shell git rev-parse --short HEAD)
|
||||
TAG_COMMIT := $(shell git rev-list --abbrev-commit --tags --max-count=1)
|
||||
TAG := $(shell git describe --abbrev=0 --tags ${TAG_COMMIT} 2>/dev/null || true)
|
||||
VERSION := $(COMMIT)
|
||||
ifeq ($(COMMIT), $(TAG_COMMIT))
|
||||
VERSION := $(TAG)
|
||||
endif
|
||||
ifneq ($(shell git status --porcelain),)
|
||||
VERSION := $(VERSION)-dirty
|
||||
endif
|
||||
endif
|
||||
VERSION ?= $(shell git describe --tags --dirty)
|
||||
|
||||
build:
|
||||
mkdir -p build
|
||||
|
||||
Reference in New Issue
Block a user