Skip to content

Commit 750b53c

Browse files
committed
small unit test fix
1 parent d46ae48 commit 750b53c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/run_conversion.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,12 @@ if [[ -n "$SPARK_PARTITIONS" ]]; then
202202
fi
203203
fi
204204

205-
JAVA_CMD=(java "${JAVA_SPARK_OPTS[@]}" -jar "$JAR" toFile -m "$IN" -o "$OUT_DIR/$OUT_NAME")
205+
# Build Java command in a macOS Bash-3-compatible way:
206+
# with `set -u`, expanding an empty array (`"${arr[@]}"`) raises "unbound variable".
207+
JAVA_CMD=(java -jar "$JAR" toFile -m "$IN" -o "$OUT_DIR/$OUT_NAME")
208+
if (( ${#JAVA_SPARK_OPTS[@]} > 0 )); then
209+
JAVA_CMD=(java "${JAVA_SPARK_OPTS[@]}" -jar "$JAR" toFile -m "$IN" -o "$OUT_DIR/$OUT_NAME")
210+
fi
206211

207212
# Ensure repeated runs with the same OUT_NAME do not accumulate old artifacts.
208213
if [[ -d "$OUT_DIR/$OUT_NAME" ]]; then

0 commit comments

Comments
 (0)