9 lines
205 B
Bash
Raw Normal View History

2018-03-05 19:34:23 +00:00
#!/bin/sh
2021-06-05 22:38:37 +01:00
if [[ $* == *--bare* ]]; then
2021-06-05 22:28:29 +01:00
# Remove the "v" prefix
git describe --tags --match="v[0-9]*\.[0-9]*\.[0-9]*" | cut -c 2-
2021-06-05 22:09:15 +01:00
else
2021-06-05 22:28:29 +01:00
git describe --tags --match="v[0-9]*\.[0-9]*\.[0-9]*"
2021-06-05 22:09:15 +01:00
fi