Skip to content

Instantly share code, notes, and snippets.

@jvyden
Last active October 4, 2019 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvyden/ef5962caa87fbe36c597ddd0018be501 to your computer and use it in GitHub Desktop.
Save jvyden/ef5962caa87fbe36c597ddd0018be501 to your computer and use it in GitHub Desktop.
osustuff-tournaments scripts n stuff

If you'd like to use this, run the following

  • chmod +x pre-commit.sh
  • mv pre-commit.sh /path/to/osustuff/.git/hooks/pre-commit

ALSO STARRING THE LEGENDARY INSTALL.SH

MADE BY LAZY PEOPLE FOR LAZY PEOPLE!

#!/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."
#!/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