gomicsv/support/get-version.sh

9 lines
213 B
Bash
Raw Normal View History

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