-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
# The whole stashing dance based on: http://stackoverflow.com/a/20480591/1435658 | ||
|
||
# First, stash index and work dir, keeping only the | ||
# to-be-committed changes in the working directory. | ||
# Will also stash uncommitted files | ||
old_stash=$(git rev-parse --quiet --verify refs/stash) | ||
git stash push --quiet --include-untracked --keep-index | ||
new_stash=$(git rev-parse --quiet --verify refs/stash) | ||
|
||
# Skip if nothing was stashed | ||
if [ "$old_stash" = "$new_stash" ]; then | ||
exit 0 | ||
fi | ||
|
||
# Restore the stash after the tests are run | ||
restore() { | ||
git reset --hard --quiet && git stash pop --index --quiet | ||
} | ||
trap restore EXIT | ||
|
||
npm run format:check || exit 1 | ||
npm run lint || exit 1 | ||
npm run test:clean || exit 1 |