diff --git a/Makefile b/Makefile index f752b90..56e82b5 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ PROJECT = softwarepublico -VERSION ?= $(shell date +%Y.%m.%d) +VERSION = $(shell git describe --tags || date +%Y.%d) TARBALL = dist/$(PROJECT)-$(VERSION).tar.gz @@ -8,6 +8,7 @@ all: sdist: $(TARBALL) $(TARBALL): $(shell git ls-files) + @if [ -n "$$(git diff-index HEAD)" ]; then echo "Cannot proceed with uncommitted changes"; false; fi mkdir -p $$(dirname $@) (git archive --prefix=$(PROJECT)-$(VERSION)/ HEAD | gzip -) > $@ -- libgit2 0.21.2