mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-10-26 13:12:25 +03:00
add semver validation
This commit is contained in:
parent
558bd5b997
commit
615cf9cb9a
@ -28,9 +28,9 @@ function info() {
|
|||||||
VERSION="$1"
|
VERSION="$1"
|
||||||
BUMP="$2"
|
BUMP="$2"
|
||||||
|
|
||||||
if [[ -z "$VERSION" ]]; then
|
# https://semver.org/
|
||||||
error "no version specified"
|
SEMVER_REGEX="^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"
|
||||||
fi
|
(echo "$VERSION" | grep -Eq "$SEMVER_REGEX") || error "'$VERSION' not a semver"
|
||||||
|
|
||||||
case "$BUMP" in
|
case "$BUMP" in
|
||||||
major)
|
major)
|
||||||
|
Loading…
Reference in New Issue
Block a user