Fix greedy match of version number

The original regex will greedily match the first digit of version
numbers that have multiple digits.
This commit is contained in:
Tjaart van der Walt 2018-05-07 14:44:35 -07:00
parent d024755718
commit 6f416b20c3

View file

@ -58,7 +58,7 @@ if test $# -gt 0; then
latest_tag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
if [[ ! "$latest_tag" =~ \
^([^0-9]*)([0-9]|[1-9][0-9]+)\.([0-9]|[1-9][0-9]+)\.([0-9]|[1-9][0-9]+)(.*) ]]; then
^([^0-9]*)([1-9][0-9]+|[0-9])\.([1-9][0-9]+|[0-9])\.([1-9][0-9]+|[0-9])(.*) ]]; then
echo "the latest tag doesn't match semver format requirement" 1>&2
exit 1
fi