#!/bin/sh set -eu # Upstream publishes only "latest". Preserve that exact Git tag and map it # reversibly to SemVer 0.0.0-latest--g, including the first commit. description=$(git describe --tags --long --match latest --dirty) case "$description" in *-dirty) echo 'Refusing dirty package' >&2; exit 1;; esac printf '0.0.0-%s\n' "$description"