Files

9 lines
355 B
Bash
Raw Permalink Normal View History

2026-10-22 17:39:25 +02:00
#!/bin/sh
set -eu
# Loops has no upstream SemVer release. Its source commit is the Git tag.
description=$(git describe --tags --long --match 'f[0-9a-f]*' --dirty)
case "$description" in *-dirty) echo 'Refusing dirty tree' >&2; exit 1 ;; esac
version=0.0.0-$description
case "$version" in *-0-g*) version=${version%%-0-g*} ;; esac
printf '%s\n' "$version"