-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example of pre-push hook (#2606)
- The example hook runs test and linter before push. - Update Contributing.md exaplining the set-up and usage.
- Loading branch information
1 parent
30d540c
commit 6462609
Showing
2 changed files
with
31 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,15 @@ | ||
#!/bin/sh | ||
# | ||
# Add this file to your .git/hooks folder without .sample extension | ||
# | ||
# Called by "git push" before anything has been pushed. | ||
# If this script exits with a non-zero status nothing will be pushed. | ||
|
||
echo "Running pre-push hook" | ||
bundle exec rake | ||
|
||
# $? stores exit value of the last command | ||
if [ $? -ne 0 ]; then | ||
echo "Rubocop and Tests must pass before pushing!" | ||
exit 1 | ||
fi |