aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-09-30 19:02:27 -0500
committerJP Dillingham <jp@dillingham.me>2026-09-30 19:02:27 -0500
commit76beb29f6e42b55a5f29a207fbca87237c40c3df (patch)
tree34fa123845b4407b527ff39fee3e60c08fa0dd78 /bin
parentf950cfdb6145b7a251f3c12f3eee14b295a4b374 (diff)
downloadslskd-76beb29f6e42b55a5f29a207fbca87237c40c3df.tar.gz
fail loudly if git isn't installed and we need it
Diffstat (limited to 'bin')
-rwxr-xr-xbin/build7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/build b/bin/build
index 8283bf25..9a15ca66 100755
--- a/bin/build
+++ b/bin/build
@@ -39,7 +39,12 @@ while test $# -gt 0; do
esac
done
-if [ -z "$version" ]; then
+if [ -z "$version" ]; then
+ if ! command -v git >/dev/null 2>&1; then
+ echo "💥 error: git is required to compose the version, but the executable couldn't be found"
+ exit 1
+ fi
+
tag=$(git describe --tags --abbrev=0)
sha=$(git rev-parse --short HEAD)
version=$tag+$sha