#!/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 --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