summaryrefslogtreecommitdiffstats
path: root/scripts/version
blob: 0e8094c22ead2f7e6f08bace754cf7d1d6eb899a (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh
set -e
cd `dirname "$0"`
if git rev-parse --verify -q jq-1.0 > /dev/null 2>&1; then
    git describe --tags --match 'jq-*' --dirty | sed 's/^jq-//'
else
    b=`git rev-parse --abbrev-ref HEAD`
    c=`git describe --always --dirty`
    echo "${b}-${c}"
fi