4 echo "not in an development environment, no .git directory found" >&2
8 # find an exact match, if found use it as version as we are currently
11 version
=`git describe --tag --exact-match 2>/dev/null`
13 echo $version |
tr -d 'v'
17 # if we are not on a exact tag, use the last tag and add the date
19 # "git describe --tag --abbrev=0 --always" does not work correctly with git versions < 1.7
21 version
=`git tag -l | sed -e 's/^v//g' | sort -n | tail -n 1`
24 major
=`echo $version | cut -d . -f 1`
25 minor
=`echo $version | cut -d . -f 2`
27 # do we have a even minor version?
29 if [ $mod -eq 0 ]; then
30 minor
=$
(printf '%02d' $
((minor
+1)))
32 version
="$major.$minor"
34 echo $version.
$date |
tr -d 'v'