-
Step 4/6 (npm test) blew up with 'Missing script: test' on a fresh frontend that hasn't wired up a test runner yet. Guard with a node-based check on package.json#scripts.test so the gate skips gracefully (with a log line) instead of failing. Lint/build still always run when frontend is tracked — only the test step is conditional on having a runner configured.
-
Untracked WIP directories (e.g. unfinished frontend/) were triggering HAS_FRONTEND=1 via bare `[ -d frontend ]`, causing the pre-push gate to lint/build code that isn't part of the push. Require non-empty `git ls-files -- <dir>` so detection follows tracked content, matching the CLAUDE.md rule that the gate covers current module + completed modules only.
-
让 git pre-push 钩子触发的子 shell 也能拿到正确的 JDK21 路径与 mysql-client 路径,避免在 PATH 短的环境下编译/连库失败。
-
2