Skip to content

Instantly share code, notes, and snippets.

@TerribleDev
Created April 18, 2019 16:13
Show Gist options
  • Save TerribleDev/0594e144539670af29cbf37b081ecb5d to your computer and use it in GitHub Desktop.
Save TerribleDev/0594e144539670af29cbf37b081ecb5d to your computer and use it in GitHub Desktop.
run checkstyle as git hook when java files have changed
javaCount=`git diff --cached --name-status | grep -i .java | wc -l | awk '{print $1}'`
if [ $javaCount -eq 0 ];
then
exit 0
else
exec ~/cargurus/cg-main/cargurus-build/local/devbox-push/run-checkstyle.sh
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment