mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-14 11:37:06 +08:00
18 lines
No EOL
474 B
Bash
Executable file
18 lines
No EOL
474 B
Bash
Executable file
#!/usr/bin/env sh
|
|
. "$(dirname -- "$0")/_/husky.sh"
|
|
|
|
# Load nvm
|
|
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
|
|
echo "Running tests before pushing to master..."
|
|
npm run test
|
|
if [ $? -ne 0 ]; then
|
|
echo "Tests failed, aborting push."
|
|
exit 1
|
|
fi
|
|
fi |