Files
jq/scripts/version
T

11 lines
285 B
Bash
Raw Normal View History

#!/bin/sh
set -eu
cd "$(dirname "$0")"
if git describe --tags --match 'jq-*' >/dev/null 2>&1; then
git describe --tags --match 'jq-*' --dirty | sed 's/^jq-//'
2017-03-03 14:28:58 -06:00
else
branch=$(git rev-parse --abbrev-ref HEAD)
commit=$(git describe --always --dirty)
echo "${branch}-${commit}"
2017-03-03 14:28:58 -06:00
fi