forked from gin/simple-template
17 lines
339 B
Bash
17 lines
339 B
Bash
#!/bin/sh
|
|
|
|
if [ -n "$CI" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
staged_files="$(git diff --cached --name-only --diff-filter=ACMR)"
|
|
|
|
if printf '%s\n' "$staged_files" | grep -q '^frontend/'; then
|
|
if ! command -v pnpm >/dev/null 2>&1; then
|
|
echo "pre-commit hook error: pnpm is required for frontend checks"
|
|
exit 1
|
|
fi
|
|
|
|
pnpm --dir frontend lint
|
|
fi
|