Skip to content

Commit 2010200

Browse files
committed
fix(run_local): bash 3.2-safe optional-flag array expansion
The diff step expanded "${CHANGED_ONLY[@]}" etc. directly; on macOS's bash 3.2 an empty array under 'set -u' errors as 'unbound variable', so the full local pipeline crashed at diff->mermaid whenever the optional flags weren't passed. Use the ${arr[@]+"${arr[@]}"} idiom (elements when set, nothing when empty) so it works on bash 3.2 and 4+.
1 parent 0ec2e0f commit 2010200

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/run_local.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ echo "== Diff -> Mermaid =="
128128
META="$(python3 "$ACTION_DIR/scripts/diff_to_mermaid.py" \
129129
--base "$BASE_ANALYSIS" --head "$HEAD_ANALYSIS" \
130130
--out "$OUT/diagram.md" --direction "$DIRECTION" \
131-
"${CHANGED_ONLY[@]}" "${NO_EDGE_LABELS[@]}" "${RENDER_DEPTH[@]}" "${EXTRA[@]}")"
131+
${CHANGED_ONLY[@]+"${CHANGED_ONLY[@]}"} ${NO_EDGE_LABELS[@]+"${NO_EDGE_LABELS[@]}"} ${RENDER_DEPTH[@]+"${RENDER_DEPTH[@]}"} ${EXTRA[@]+"${EXTRA[@]}"})"
132132
echo " $META"
133133

134134
# Browser preview: render the (fence-stripped) mermaid via mermaid.js, strict mode

0 commit comments

Comments
 (0)