Files
vue-ts-example/.husky/pre-commit
严浩 f302a56d2c
Some checks failed
/ depcheck (push) Failing after 37s
/ playwright (push) Failing after 1m43s
/ build-and-deploy-to-vercel (push) Failing after 1m5s
chore: 更新 pre-commit 钩子,添加运行提示图标
2024-10-19 15:44:24 +08:00

13 lines
377 B
Bash

#!/bin/bash
echo "🔧 Running pre-commit hook..."
if command -v pnpm >/dev/null 2>&1; then
# 如果 pnpm 可用,直接使用它
pnpm exec lint-staged
else
# 如果 pnpm 不可用,使用 $HOME/.local/bin/pnpm
# ln -s $(which pnpm) $HOME/.local/bin/pnpm
echo "pnpm not found, using $HOME/.local/bin/pnpm"
"$HOME"/.local/bin/pnpm exec lint-staged
fi