1
Fork 0

[release] update version regexp to allow -rc

This commit is contained in:
Motiejus Jakštys 2021-12-13 03:26:23 +02:00
parent 985e26b474
commit 367a770766
1 changed files with 2 additions and 2 deletions

View File

@ -6,8 +6,8 @@ _err(){ >&2 echo "ERROR: $*"; exit 1; }
git status --porcelain | grep -q "" &&
_err "working tree is dirty, commit your changes first."
[[ "$1" =~ ^v([0-9]+)\.([0-9]+)(\.([0-9]+))?$ ]] || \
_err "arg1 accepts the following formats: v1.0 v1.0.0"
[[ "$1" =~ ^v([0-9]+)\.([0-9]+)(\.([0-9]+))?(-rc([0-9]+))?$ ]] || \
_err "arg1 accepts the following formats: v1.0 v1.0.0 v1.0-rc1 v1.0.1-rc1"
git tag | grep -q "^$1$" &&
_err "tag $1 already exists"