Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pre-Push
#!/bin/sh
CMD="./gradlew clean testDebugUnitTest"
# Check if we actually have commits to push
commits=`git log @{u}..`
if [ -z$commits” ]; then
exit 0
fi
$CMD
RESULT=$?
if [ $RESULT -ne 0 ]; then
echo “failed $CMD
exit 1
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment