From 3ed928954a0365828d53ac1fd6a41343b4dbff7d Mon Sep 17 00:00:00 2001 From: itchyny Date: Thu, 20 Jul 2023 23:12:41 +0900 Subject: Fail quickly if not in git repository in scripts/version --- scripts/version | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/version b/scripts/version index d56dd9a7..ba59e6b6 100755 --- a/scripts/version +++ b/scripts/version @@ -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 -- cgit v1.2.3