Files
jellyfin-deployment/scripts/chart-version.sh
T

9 lines
373 B
Bash
Raw Permalink Normal View History

#!/bin/sh
set -eu
description=$(git describe --tags --long --match 'v[0-9]*' --dirty)
case "$description" in *-dirty) echo 'Refusing dirty tree' >&2; exit 1 ;; esac
version=${description#v}
case "$version" in *-0-g*) version=${version%%-0-g*} ;; esac
version=$(printf '%s\n' "$version" | sed -E 's/^([0-9]+\.[0-9]+)(-[0-9]+-g[0-9a-f]+)?$/\1.0\2/')
printf '%s\n' "$version"