Created
October 31, 2015 15:41
-
-
Save homam/58a7e98f8fdb0f3034ee to your computer and use it in GitHub Desktop.
git commit spell checker
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 | |
| # brew install aspell | |
| # nano .git/hooks/commit-msg | |
| # chmod +x .git/hooks/commit-msg | |
| ASPELL=$(which aspell) | |
| if [ $? -ne 0 ]; then | |
| echo "Aspell not installed - unable to check spelling" >&2 | |
| exit | |
| else | |
| WORDS=$($ASPELL list < "$1") | |
| fi | |
| if [ -n "$WORDS" ]; then | |
| echo -e "\e[1;33m\t\n\tPossible mispelled words: \n\n"$WORDS"\n\e[0m" >&2 | |
| fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment