Skip to content

Instantly share code, notes, and snippets.

@gmurphey
Created December 3, 2013 16:03
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 gmurphey/7771809 to your computer and use it in GitHub Desktop.
Save gmurphey/7771809 to your computer and use it in GitHub Desktop.
#!/bin/sh
# stash unstaged changes, run build task, stage release updates and restore stashed files
NAME=$(git branch | grep '*' | sed 's/* //')
# don't run on rebase
if [ $NAME != '(no branch)' ]
then
git stash -q --keep-index
grunt
RETVAL=$?
if [ $RETVAL -ne 0 ]
then
exit 1
fi
git add .
git stash pop -q
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment