test(plugins): guard the consumer-neutral test's array expansion
test-vale-wrap's bash 3.2 scan flags a bare "${arr[@]}" expansion under
set -u. Use the guarded form the repo's other scripts use.
Refs: #177
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
This commit is contained in:
1 parent
05dffc3e45
commit
75ec543b4b
1 file changed
+3
-2
@@ -35,8 +35,9 @@ assert_absent() {
|
|||||||
fi
|
fi
|
||||||
dirs+=("plugins/$plugin/.apm")
|
dirs+=("plugins/$plugin/.apm")
|
||||||
done
|
done
|
||||||
# grep exits 1 on no match, which is the passing case here.
|
# grep exits 1 on no match, which is the passing case here. The guarded
|
||||||
hits="$(cd "$REPO_ROOT" && grep -rnI $flags -e "$pattern" -- "${dirs[@]}" || true)"
|
# expansion keeps bash 3.2 happy under `set -u`.
|
||||||
|
hits="$(cd "$REPO_ROOT" && grep -rnI $flags -e "$pattern" -- ${dirs[@]+"${dirs[@]}"} || true)"
|
||||||
if [[ -z "$hits" ]]; then
|
if [[ -z "$hits" ]]; then
|
||||||
pass "$label"
|
pass "$label"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in new issue
Block a user