From 126831e96f473aa734e31f29d67e8213646af61c Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Wed, 2 Dec 2026 10:29:51 +0000 Subject: [PATCH] fix(scripts): expand APM_CMD bash-3.2-safely in apm-pack-check-clean The helper now seeds APM_CMD empty, and a bare "${APM_CMD[@]}" on an array that can be empty fails under `set -u` on bash 3.2. The bash-4 construct scan in tests/test-vale-wrap.sh caught it at pre-push. Use the guarded expansion that run_apm already uses. Refs: #271 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi --- scripts/apm-pack-check-clean.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/apm-pack-check-clean.sh b/scripts/apm-pack-check-clean.sh index d64c0e4..f960b2f 100755 --- a/scripts/apm-pack-check-clean.sh +++ b/scripts/apm-pack-check-clean.sh @@ -11,4 +11,6 @@ set -euo pipefail source "$(dirname "${BASH_SOURCE[0]}")/lib/apm.sh" require_apm_version || exit 1 -exec "${APM_CMD[@]}" pack --check-versions --check-clean --dry-run +# The guarded expansion keeps bash 3.2 happy under `set -u`: the helper seeds +# APM_CMD empty, and require_apm_version has already refused an empty one. +exec ${APM_CMD[@]+"${APM_CMD[@]}"} pack --check-versions --check-clean --dry-run