Skip to content

Instantly share code, notes, and snippets.

@ZahidRasheed
Created July 20, 2017 13:58
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 ZahidRasheed/70c399af32d58267573b173dff762ce7 to your computer and use it in GitHub Desktop.
Save ZahidRasheed/70c399af32d58267573b173dff762ce7 to your computer and use it in GitHub Desktop.
A git pre-push hook to make sure there are no lint errors before pushing code to the remote.
#!/bin/sh
echo "executing post-push hook to make sure lint is not failing the build"
# run the tests with the gradle wrapper
./gradlew lintProductionRelease
# store the last exit code in a variable
RESULT=$?
# return the './gradlew test' exit code
exit $RESULT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment