diff --git a/Makefile b/Makefile index 0f05c93..4c54203 100644 --- a/Makefile +++ b/Makefile @@ -14,9 +14,7 @@ default: lvspec.pdf # outputs a version string to uniquely identify the document revision # TODO: use tag name if matches current commit verstr.tex: - git log -n1 --format=%h | tr -d '\n' > verstr.tex - test -z "$$( git status -s | grep -v '^?? ' )" \ - || echo -n '-dirty' >> verstr.tex + verstr >$@ clean: rm -f *.pdf diff --git a/verstr b/verstr new file mode 100755 index 0000000..08e6a02 --- /dev/null +++ b/verstr @@ -0,0 +1,10 @@ +#!/bin/sh +# +# Generates version string + +# output current shortref +git log -n1 --format=%h | tr -d '\n' + +# if we have uncommitted changes, then append with -dirty +test -z "$$( git status -s | grep -v '^?? ' )" \ + || echo -n '-dirty'