From f47c97f895184d70a9c280edb938a69c116c36da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Tue, 10 Sep 2024 17:33:55 +0800 Subject: [PATCH] chore: Update pre-commit script to handle pnpm availability Update the pre-commit script to handle the availability of pnpm. If pnpm is not available, the script will use the alternative path $HOME/.local/bin/pnpm. This change ensures that the lint-staged command is executed correctly regardless of the availability of pnpm. --- .husky/pre-commit | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.husky/pre-commit b/.husky/pre-commit index 31c799b..16b2f37 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -5,5 +5,7 @@ if command -v pnpm >/dev/null 2>&1; then 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 \ No newline at end of file