Skip to content

Instantly share code, notes, and snippets.

@hamen
Created November 8, 2018 10:31
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 hamen/f080a06b6283c61da637cf81388f4b4e to your computer and use it in GitHub Desktop.
Save hamen/f080a06b6283c61da637cf81388f4b4e to your computer and use it in GitHub Desktop.
#!/bin/bash
CMD="./gradlew clean test"
# 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