Skip to content

Instantly share code, notes, and snippets.

@raku-cat
Created May 6, 2016 13:02
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 raku-cat/89a71569f2e6507bed34019411a34629 to your computer and use it in GitHub Desktop.
Save raku-cat/89a71569f2e6507bed34019411a34629 to your computer and use it in GitHub Desktop.
#/bin/bash
git -C $1 fetch
LOCAL=$(git -C $1 rev-parse @)
REMOTE=$(git -C $1 rev-parse @{u})
BASE=$(git -C $1 merge-base @ @{u})
if [ $LOCAL = $REMOTE ]; then
echo "You're up to date"
exit 0
elif [ $LOCAL = $BASE ]; then
git -C $1 pull
gradle -p $1 assemble
exit 0
else
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment