chore: update hooks

use nvm install, quiet exit in post checkout if nvm is not available
This commit is contained in:
Miodec 2025-08-10 13:18:10 +02:00
parent 436fafcc60
commit a387d8269d
2 changed files with 11 additions and 1 deletions

View file

@ -1,4 +1,14 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# Load nvm
export NVM_DIR="$HOME/.nvm"
if [ ! -s "$NVM_DIR/nvm.sh" ]; then
# nvm not available, quietly exit
exit 0
fi
. "$NVM_DIR/nvm.sh"
nvm install
pnpm i

View file

@ -7,7 +7,7 @@ export NVM_DIR="$HOME/.nvm"
if [ $(git branch --no-color | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') = "master" ] && [ $(git remote get-url origin) = "https://github.com/monkeytypegame/monkeytype" ]; then
nvm use
nvm install
echo "Running a full check before pushing to master..."
npm run full-check
if [ $? -ne 0 ]; then