5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-12-01 09:21:35 +00:00
yggdrasil-go/contrib/semver/version.sh
2021-06-06 02:33:11 -05:00

12 lines
216 B
Bash

#!/bin/sh
case "$*" in
*--bare*)
# Remove the "v" prefix
git describe --tags --match="v[0-9]*\.[0-9]*\.[0-9]*" | cut -c 2-
;;
*)
git describe --tags --match="v[0-9]*\.[0-9]*\.[0-9]*"
;;
esac