Files

13 lines
316 B
Bash
Raw Permalink Normal View History

2026-10-18 23:42:36 +02:00
#!/usr/bin/env bash
set -euo pipefail
description=$(git describe --tags --long --match 'v[0-9]*' --dirty)
case "$description" in
*-dirty) echo 'Refusing to package a dirty tree.' >&2; exit 1 ;;
esac
version=${description#v}
case "$version" in
*-0-g*) version=${version%%-0-g*} ;;
esac
printf '%s\n' "$version"