This repository has been archived on 2026-10-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files

18 lines
386 B
Bash
Executable File

#!/bin/sh
set -eu
if [ "$#" -ne 1 ]; then
echo "usage: $0 CHART" >&2
exit 2
fi
chart=$1
description=$(git describe --tags --long --match "${chart}-v[0-9]*" --dirty)
case "$description" in
*-dirty) echo "refusing to package a dirty tree" >&2; exit 1 ;;
esac
version=${description#${chart}-v}
case "$version" in
*-0-g*) version=${version%%-0-g*} ;;
esac
printf '%s\n' "$version"