gomicsv/support/get-version.sh
2022-09-10 13:59:53 +02:00

9 lines
213 B
Bash
Executable file

#!/usr/bin/env bash
VERSION_TAG=$(git tag -l | grep "v" | tail -n1 | cut -c2-);
if [[ ${#VERSION_TAG} -ne 0 ]]; then
echo "$VERSION_TAG";
else
HASH=$(git rev-parse --short HEAD);
printf "git-%s" "$HASH"
fi;