Skip to content

Commit a387d82

Browse files
committed
chore: update hooks
use nvm install, quiet exit in post checkout if nvm is not available
1 parent 436fafc commit a387d82

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.husky/post-checkout

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4+
# Load nvm
5+
export NVM_DIR="$HOME/.nvm"
6+
if [ ! -s "$NVM_DIR/nvm.sh" ]; then
7+
# nvm not available, quietly exit
8+
exit 0
9+
fi
10+
. "$NVM_DIR/nvm.sh"
11+
12+
13+
nvm install
414
pnpm i

.husky/pre-push

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export NVM_DIR="$HOME/.nvm"
77

88

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

0 commit comments

Comments
 (0)