chore: Update pre-commit script to handle pnpm availability
All checks were successful
CI / cache-and-install (push) Successful in 1m37s
All checks were successful
CI / cache-and-install (push) Successful in 1m37s
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.
This commit is contained in:
@ -5,5 +5,7 @@ if command -v pnpm >/dev/null 2>&1; then
|
|||||||
pnpm exec lint-staged
|
pnpm exec lint-staged
|
||||||
else
|
else
|
||||||
# 如果 pnpm 不可用,使用 $HOME/.local/bin/pnpm
|
# 如果 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
|
"$HOME"/.local/bin/pnpm exec lint-staged
|
||||||
fi
|
fi
|
Reference in New Issue
Block a user