From 372ac50d688b8b2d9b307efe451365fa9c171e90 Mon Sep 17 00:00:00 2001 From: Say Cheong Date: Thu, 13 Jun 2024 13:38:07 +0900 Subject: [PATCH] Changed to more elaborate version matching --- Libplanet.Tools/bin/npm-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libplanet.Tools/bin/npm-test.sh b/Libplanet.Tools/bin/npm-test.sh index 121a3f97ac3..4dec8353a57 100755 --- a/Libplanet.Tools/bin/npm-test.sh +++ b/Libplanet.Tools/bin/npm-test.sh @@ -3,7 +3,7 @@ set -e if [[ "$1" = "" ]]; then echo error: missing version to download >&2 exit 1 -elif [[ "$1" =~ ^([1-9][0-9]*|0)\.([1-9][0-9]*|0)\.([1-9][0-9]*|0)$ ]]; then +elif [[ "$1" =~ ^(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-]+)*))?$ ]]; then version="$1" else echo error: invalid version number: "$1" >&2