chmod +x pre-commit.sh
mv pre-commit.sh /path/to/osustuff/.git/hooks/pre-commit
Last active
October 4, 2019 18:24
-
-
Save jvyden/ef5962caa87fbe36c597ddd0018be501 to your computer and use it in GitHub Desktop.
osustuff-tournaments scripts n stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ROOTDIR=$(pwd) | |
echo "Installing front-end..." | |
cd $ROOTDIR/front-end | |
npm install | |
printf "Installed front-end.\nInstalling back-end...\n" | |
cd $ROOTDIR/back-end | |
npm install | |
echo "Installed back-end." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GROOT=$(git rev-parse --show-toplevel) | |
printf "Running lint in back-end...\n" | |
cd $GROOT/back-end | |
npm run --silent lint | |
RESULT1=$? | |
printf "Running lint in front-end...\n" | |
cd $GROOT/front-end | |
npm run --silent lint | |
RESULT2=$? | |
if [ $RESULT1 -gt 0 ] || [ $RESULT2 -gt 0]; then | |
printf "Lint didn't pass. Not commiting.\n" | |
exit 1 | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment