agent-desktop/scripts/check-bash3-compat.sh
Lahfir 4add46ab38 chore: checkpoint five verified remediation rounds before e2e convergence
Freezes the working tree as a fixed baseline: static gates green (1551 lib
tests, clippy -D warnings, fmt, release 0.4.7), live-verified E1/E2 fixes,
notification/harness work pending e2e acceptance. Known-open: hover fixture
churn to back out, 3 e2e failures (hover oracle, AE6 sheet, sheet cancel),
NT1-NT4 unproven.
2026-07-11 22:06:13 -07:00

16 lines
575 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
repo="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$repo"
files=(.githooks/pre-commit scripts/*.sh tests/e2e/*.sh)
for file in "${files[@]}"; do
/bin/bash -n "$file"
done
forbidden='declare[[:space:]]+-[a-zA-Z]*A|typeset[[:space:]]+-[a-zA-Z]*A|(^|[^[:alnum:]_])(mapfile|readarray|coproc)([^[:alnum:]_]|$)|\$\{[^}]+(,,|\^\^)'
if grep -En "$forbidden" "${files[@]}" | grep -v '^scripts/check-bash3-compat\.sh:'; then
echo "Bash 4+ syntax is not allowed in scripts that promise macOS Bash 3.2 support" >&2
exit 1
fi