zentol commented on a change in pull request #11764: [FLINK-17023][scripts] Fix 
format checking of extractExecutionParams in config.sh
URL: https://github.com/apache/flink/pull/11764#discussion_r410035498
 
 

 ##########
 File path: flink-dist/src/main/flink-bin/bin/config.sh
 ##########
 @@ -644,9 +644,17 @@ extractExecutionParams() {
     local execution_config=$1
     local EXECUTION_PREFIX="BASH_JAVA_UTILS_EXEC_RESULT:"
 
-    if ! [[ $execution_config =~ ^${EXECUTION_PREFIX}.* ]]; then
+    local line_count=`echo "$execution_config" | grep "" -c`
+    if ! [[ ${line_count} == 1 ]]; then
+        echo "[ERROR] Unexpected result ($line_count lines): 
$execution_config" 1>&2
+        echo "[ERROR] extractExecutionParams only accepts exactly one line as 
the input" 1>&2
+        echo "$output" 1>&2
+        exit 1
+    fi
+
+    if ! [[ ${execution_config} =~ ^${EXECUTION_PREFIX}.* ]]; then
         echo "[ERROR] Unexpected result: $execution_config" 1>&2
-        echo "[ERROR] The last line of the BashJavaUtils outputs is expected 
to be the execution result, following the prefix '${EXECUTION_PREFIX}'" 1>&2
+        echo "[ERROR] The output of BashJavaUtils is expected to be the 
execution result, following the prefix '${EXECUTION_PREFIX}'" 1>&2
         echo "$output" 1>&2
 
 Review comment:
   same here, $output isn't defined anywhere

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to