Husky 遇到 command not found: husky
All checks were successful
CI / cache-and-install (push) Successful in 1m23s

This commit is contained in:
严浩
2024-08-22 11:26:46 +08:00
parent 1e9e6a7835
commit f5a328d79f
2 changed files with 14 additions and 40 deletions

View File

@ -1,2 +1,9 @@
echo "Running pre-commit hook..."
pnpm exec lint-staged
if command -v pnpm >/dev/null 2>&1; then
# 如果 pnpm 可用,直接使用它
pnpm exec lint-staged
else
# 如果 pnpm 不可用,使用 $HOME/.local/bin/pnpm
"$HOME"/.local/bin/pnpm exec lint-staged
fi