1 #! /bin/sh
3 DEFAULT_VERSION="0.0.0.git"
5 VERSION="$( git describe --tags 2> /dev/null | sed -e 's/foobar-//' )"
7 if test -z "$VERSION"; then
8 VERSION="$DEFAULT_VERSION"
9 else
10 git update-index -q --refresh
11 if test -n "$( git diff-index --name-only HEAD )"; then
12 VERSION="$VERSION-dirty"
13 fi
14 fi
16 VERSION="$( echo "$VERSION" | sed -e 's/-/./g' )"
17 echo -n "$VERSION"