aboutsummaryrefslogtreecommitdiff
path: root/git-version.sh
blob: 28ecb69cf9283f01032d9d606f214f1ac4e5016d (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh

if [ -d .git ]; then
    VERSION="`cat .git/HEAD`"
    case $VERSION in
        ref:*) ref="${VERSION#ref: }"; VERSION="`cat .git/$ref`";;
            *) ;;
    esac
fi

echo ${VERSION:-no git}