Last active
September 2, 2017 16:59
-
-
Save thomd/e95f38dd7c376312bd94 to your computer and use it in GitHub Desktop.
git hooks
This file contains hidden or 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
| #!/bin/sh | |
| # take a picture and play happykids.wav (http://collectiveidea.com/assets/4c58e4c1dabe9d50eb000087/happykids.wav) | |
| # from: collectiveidea.com/blog/archives/2010/08/03/happy-git-commits | |
| imagesnap -q ~/.gitshots/$(date +"%Y-%m-%d_%H:%M:%S")_$(basename `pwd`).jpg & afplay ~/Music/happykids.wav > /dev/null 2>&1 & |
This file contains hidden or 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
| #!/bin/zsh | |
| function lintit () { | |
| OUTPUT=$(git diff --name-only | grep -E '(.js)$') | |
| a=("${(f)OUTPUT}") | |
| e=$(eslint -c eslint.json $a) | |
| echo $e | |
| if [[ "$e" != *"0 problems"* ]]; then | |
| echo "ERROR: Check eslint hints." | |
| exit 1 # reject | |
| fi | |
| } | |
| lintit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment