Skip to content

Commit a9f5de1

Browse files
chore: update regexp examples
1 parent ebfaa3d commit a9f5de1

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

scripts/generate.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,19 @@ done
1616

1717
VERSION=${VERSION//develop/dev}
1818

19-
# Example for the regex below:
20-
# dev.1.0.0.0
21-
# dev-1.0.0-0
22-
# dev.1.0.0-0
23-
# dev-1.0.0.0
2419
if [[ $VERSION =~ ^dev[.-]([0-9]+)[.-]([0-9]+)[.-]([0-9]+)[.-]([0-9]+)$ ]]; then
20+
# Example for the regex above:
21+
# dev.1.0.0.0
22+
# dev-1.0.0-0
23+
# dev.1.0.0-0
24+
# dev-1.0.0.0
2525
VERSION="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.${BASH_REMATCH[3]}-beta.${BASH_REMATCH[4]}"
2626
elif [[ $VERSION =~ ^([0-9]+)[.-]([0-9]+)[.-]([0-9]+)[.-]dev[.-]([0-9]+)$ ]]; then
27+
# Example for the regex above:
28+
# 1.0.0.dev.0
29+
# 1.0.0.dev-0
30+
# 1.0.0-dev-0
31+
# 1.0.0-dev.0
2732
VERSION="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.${BASH_REMATCH[3]}-beta.${BASH_REMATCH[4]}"
2833
elif [[ $VERSION == dev-* ]]; then
2934
_temp_part=${VERSION#dev-}

0 commit comments

Comments
 (0)