chore: change dev version format to <latest_tag>-dev+<current_sha>

This commit is contained in:
jo 2022-04-21 19:48:44 +02:00 committed by Kyle Robbertze
parent 0a6ed33d96
commit bc5e92474e
1 changed files with 3 additions and 1 deletions

View File

@ -15,7 +15,9 @@ typeset -r version_file="VERSION"
if [[ "$(git rev-parse --is-inside-work-tree 2> /dev/null)" == "true" ]]; then
tag=$(git tag --points-at HEAD | tee "$version_file" || error "could not extract tag")
if [[ -z "$tag" ]]; then
git rev-parse --short HEAD > "$version_file" || error "could not extract commit sha"
latest_tag=$(git describe --abbrev=0 --tags || error "could not extract latest tag")
latest_commit=$(git rev-parse --short HEAD || error "could not extract commit sha")
echo "$latest_tag-dev+$latest_commit" > "$version_file"
fi
else
if [[ ! -f "$version_file" ]]; then