snuyanzin commented on code in PR #62:
URL: 
https://github.com/apache/flink-connector-shared-utils/pull/62#discussion_r4371047962


##########
_utils.sh:
##########
@@ -71,8 +81,12 @@ function set_pom_version {
 }
 
 function is_flink_version_set_in_pom {
+  local version
   set +u
-  version=$(${MVN} help:evaluate -Dexpression="flink.version" -q -DforceStdout)
+  version=$(${MVN} help:evaluate -Dexpression="flink.version" -q 
-DforceStdout) || {
+    echo "Maven failed to read flink.version." >&2
+    exit 1
+  }

Review Comment:
   how about  something like
   ```bash
   if [[ ${version} =~ ^[0-9]+(\.[0-9]+)*(-[0-9A-Za-z.]+)*$ ]]; then
     echo "true"
   elif [[ ${version} == "null object or invalid expression" ]]; then
     echo "false"
   else
     echo "Unexpected flink.version '${version}'." >&2
     exit 1
   fi
   ```
   otherwise network issue might lead to wrong result



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to