Makefile: Refuse to build release from unclean repo
authorisaacs <i@izs.me>
Sat, 16 Jun 2012 15:51:33 +0000 (08:51 -0700)
committerisaacs <i@izs.me>
Sat, 16 Jun 2012 15:51:33 +0000 (08:51 -0700)
Root cause of an error during the 0.7.11 release

Makefile

index 52d90f0f95c9a3b6b5eeeddb9e6a5e2686bca054..3eada059b43fd0498d9d6b015e4661ed67aefcfd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -208,6 +208,17 @@ $(PKG):
                --out $(PKG)
 
 $(TARBALL): node out/doc
+       @if [ "$(shell git status --porcelain | egrep -v '^\?\? ')" = "" ]; then \
+               exit 0 ; \
+       else \
+         echo "" >&2 ; \
+               echo "The git repository is not clean." >&2 ; \
+               echo "Please commit changes before building release tarball." >&2 ; \
+               echo "" >&2 ; \
+               git status --porcelain | egrep -v '^\?\?' >&2 ; \
+               echo "" >&2 ; \
+               exit 1 ; \
+       fi
        @if [ $(shell ./node --version) = "$(VERSION)" ]; then \
                exit 0; \
        else \