Skip to content

Instantly share code, notes, and snippets.

@sjeandeaux
Created January 29, 2016 08:58
Show Gist options
  • Save sjeandeaux/bb4d3c589be16b561e44 to your computer and use it in GitHub Desktop.
Save sjeandeaux/bb4d3c589be16b561e44 to your computer and use it in GitHub Desktop.
#!/bin/sh
git stash -q --keep-index
###############################################################
#
# your command e.g : sbt clean compile
#
###############################################################
RESULT=$?
if [ $RESULT -eq 0 ]
then
git diff --quiet
RESULT=$?
if [ $RESULT -ne 0 ]
then
echo "Houston we have a problem with this f**g files:"
git diff --name-only
echo "Probably just add to your commit"
fi
fi
git stash pop -q
exit $RESULT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment