Skip to content

Commit 29fd15f

Browse files
committed
release-version: add an extra sanity check
In theory, the property extraction will exit non-zero whenever there is an error, so this new check should never be triggered. But I'm paranoid, so just in case, let's check the projectDetails result string, too.
1 parent 98057cc commit 29fd15f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

release-version.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ echoArg='${project.version}:${license.licenseName}:${project.parent.groupId}:${p
116116
projectDetails=$(mvn -N -Dexec.executable=echo -Dexec.args="$echoArg" exec:exec -q)
117117
test $? -eq 0 || projectDetails=$(mvn -U -N -Dexec.executable=echo -Dexec.args="$echoArg" exec:exec -q)
118118
test $? -eq 0 || die "Could not extract version from pom.xml. Error follows:\n$projectDetails"
119+
echo "$projectDetails" | grep -Fqv '[ERROR]' ||
120+
die "Error extracting version from pom.xml. Error follows:\n$projectDetails"
119121
currentVersion=${projectDetails%%:*}
120122
projectDetails=${projectDetails#*:}
121123
licenseName=${projectDetails%%:*}

0 commit comments

Comments
 (0)