Fail quickly if not in git repository in scripts/version

This commit is contained in:
itchyny authored and Nico Williams committed 2023-07-21 08:59:17 -05:00
1 parent 4732dd82c0
commit 3ed928954a
1 file changed
+3 -1
+3 -1
View File
@@ -1,7 +1,9 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")"
cd "$(dirname "$0")/../"
test -d .git || exit 1
if git describe --tags --match 'jq-*' >/dev/null 2>&1; then
git describe --tags --match 'jq-*' --dirty | sed 's/^jq-//'
else