Skip to content

Commit

Permalink
Merge pull request #1 from glenn-allen/avoid-local-changes
Browse files Browse the repository at this point in the history
Local changes should be stashed before running the hook, as these are…
  • Loading branch information
dflourusso committed Mar 10, 2016
2 parents 37592f4 + b433ed8 commit 25ca738
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions hook
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

git stash -q --keep-index

NODE=`which node 2> /dev/null`
NODEJS=`which nodejs 2> /dev/null`
IOJS=`which iojs 2> /dev/null`
Expand All @@ -14,3 +16,9 @@ elif [[ -n $IOJS ]]; then
elif [[ -x $LOCAL ]]; then
"$LOCAL" $("$LOCAL" -e "console.log(require.resolve('pre-push'))")
fi
RESULT=$?

git stash pop -q
[ $RESULT -ne 0 ] && exit 1
exit 0

0 comments on commit 25ca738

Please sign in to comment.