chore(husky): run nvm use only when needed (#5524)

`nvm use` does not work on nvm-windows and there is no need for it to
run everytime anyone pushes to any branch
This commit is contained in:
Nad Alaba 2024-06-25 11:21:34 +03:00 committed by GitHub
parent f123617c33
commit 5c618082c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,9 +6,8 @@ export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm use
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
echo "Running tests before pushing to master..."
npm run test
if [ $? -ne 0 ]; then