mirror of
https://github.com/tj/git-extras.git
synced 2026-09-14 09:26:19 -04:00
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:
parent
d024755718
commit
6f416b20c3
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue