commit a74dac72d4b01004498a539705095cad6254e8a8
Author: Bruno Wolff III <bruno(a)wolff.to>
Date: Sat Jun 29 13:44:27 2013 -0500
Use a git hash for the version if HEAD isn't tagged
Makefile | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/Makefile b/Makefile
index baadf3b..6cc8d7b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,17 @@
+# Get the version name first by seeing if HEAD is tagged
+version := $(shell git tag --points-at HEAD)
+# And if it wasn't use a git hash
+ifeq ($(version),)
+ version := $(shell git log -1 --abbrev=8 --pretty=git%h)
+endif
+
all: dist
clean:
rm -f spin-kickstarts-*.tar.gz
dist:
- git archive --format=tar --prefix=spin-kickstarts-`git tag --points-at HEAD`/ HEAD |
gzip > spin-kickstarts.tar-`git tag --points-at HEAD`.gz
+ git archive --format=tar --prefix=spin-kickstarts-$(version)/ HEAD | gzip >
spin-kickstarts.tar-$(version).gz
dist-clean:
git clean -f -d
Show replies by date