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 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
17 lines
861 B
Bash
Executable File
17 lines
861 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# apm-pack-check-clean pre-push hook: `apm pack --check-versions --check-clean
|
|
# --dry-run`, run through scripts/lib/apm.sh. That helper runs the repo-pinned
|
|
# apm as `uv run --project <repo root> --frozen apm` (ADR-0034), fails clearly
|
|
# below the minimum version, and scrubs git's repo-locating env first -- see
|
|
# scripts/lib/clean-git-env.sh and issue #204, and docs/spec/gates.md,
|
|
# "apm-audit-ci", the "apm runs with git's repo-locating env scrubbed" paragraph.
|
|
set -euo pipefail
|
|
|
|
# shellcheck source=scripts/lib/apm.sh
|
|
source "$(dirname "${BASH_SOURCE[0]}")/lib/apm.sh"
|
|
|
|
require_apm_version || exit 1
|
|
# 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
|