mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-09-04 05:38:55 +08:00
chore: update hooks
use nvm install, quiet exit in post checkout if nvm is not available
This commit is contained in:
parent
436fafcc60
commit
a387d8269d
2 changed files with 11 additions and 1 deletions
|
@ -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
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue