Skip to content

Commit a67a660

Browse files
authored
fix: reject non-semver strings in release.sh (#84)
Fail when the next version is specified as a non-semver string, e.g. "minor" or "patch". Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
1 parent 93501c6 commit a67a660

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

release.sh

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ git diff --quiet HEAD || (echo "please revert the uncommited changes"; exit 1)
55

66
SPARK_VERSION="${1?Missing required argument: semver}"
77

8+
(echo "$SPARK_VERSION" | grep -Eq '^\d+\.\d+\.\d+$') || {
9+
echo Invalid version string \'$SPARK_VERSION\'. Must be MAJOR.MINOR.PATCH
10+
exit 1
11+
}
12+
813
sed -i '' -e "s/SPARK_VERSION = .*/SPARK_VERSION = '$SPARK_VERSION'/" lib/constants.js
914
git add lib/constants.js
1015
git commit -m v"$SPARK_VERSION"

0 commit comments

Comments
 (0)