pre-commit 339 B

12345678910111213141516
  1. #!/bin/sh
  2. if [ -n "$CI" ]; then
  3. exit 0
  4. fi
  5. staged_files="$(git diff --cached --name-only --diff-filter=ACMR)"
  6. if printf '%s\n' "$staged_files" | grep -q '^frontend/'; then
  7. if ! command -v pnpm >/dev/null 2>&1; then
  8. echo "pre-commit hook error: pnpm is required for frontend checks"
  9. exit 1
  10. fi
  11. pnpm --dir frontend lint
  12. fi