diff options
author | Miodec <[email protected]> | 2024-05-29 14:34:13 +0200 |
---|---|---|
committer | Miodec <[email protected]> | 2024-05-29 14:34:13 +0200 |
commit | 16b794412b76add4c298345b6b4f65681cd94aa6 (patch) | |
tree | af04d34a830392d770f3990eca95b160ef55a2cf /.husky | |
parent | 57ff186f91a0024cf04d4e228ccea3538e6d9976 (diff) | |
download | monkeytype-16b794412b76add4c298345b6b4f65681cd94aa6.tar.gz monkeytype-16b794412b76add4c298345b6b4f65681cd94aa6.zip |
chore: make sure to run tests before pushing to master
Diffstat (limited to '.husky')
-rw-r--r-- | .husky/pre-push | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100644 index 000000000..e357d07c6 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,11 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +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
\ No newline at end of file |