Skip to content

Commit

Permalink
Fail quickly if not in git repository in scripts/version
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny authored and nicowilliams committed Jul 21, 2023
1 parent 4732dd8 commit 3ed9289
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/version
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 3ed9289

Please sign in to comment.