Skip to content

Commit

Permalink
Merge pull request #3823 from greymistcube/chore/fix-ci
Browse files Browse the repository at this point in the history
👷 Changed to more elaborate version matching
  • Loading branch information
greymistcube authored Jun 13, 2024
2 parents ebb5e84 + 7cf61b1 commit 31be608
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Libplanet.Tools/bin/npm-test.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#!/bin/bash
set -e

# Taken from https://github.com/har7an/bash-semver-regex
# Regex for a semver digit
D='0|[1-9][0-9]*'
# Regex for a semver pre-release word
PW='[0-9]*[a-zA-Z-][0-9a-zA-Z-]*'
# Regex for a semver build-metadata word
MW='[0-9a-zA-Z-]+'

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" =~ ^($D)\.($D)\.($D)(-(($D|$PW)(\.($D|$PW))*))?(\+($MW(\.$MW)*))?$ ]]; then
version="$1"
else
echo error: invalid version number: "$1" >&2
Expand Down

0 comments on commit 31be608

Please sign in to comment.