Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

executable file 17 lines (14 sloc) 0.337 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#!/bin/sh

LF='
'

VN=$(git describe --match "v[0-9]*" --abbrev=4 HEAD 2>/dev/null)
case "$VN" in
    *$LF*) (exit 1) ;;
v[0-9]*)
        git update-index -q --refresh
        test -z "$(git diff-index --name-only HEAD --)" ||
        VN="$VN-dirty" ;;
esac
VN=$(echo "$VN" | sed -e 's/-/./g');
VN=$(expr "$VN" : v*'\(.*\)')

echo "$VN"
Something went wrong with that request. Please try again.