8 lines
355 B
Bash
Executable File
8 lines
355 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
# Upstream publishes only "latest". Preserve that exact Git tag and map it
|
|
# reversibly to SemVer 0.0.0-latest-<count>-g<hash>, 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"
|