Created
June 2, 2016 17:16
-
-
Save bchopson/fb9e230f5e84733335f37dc143fdb299 to your computer and use it in GitHub Desktop.
Pre-commit hook to enforce space after function keyword
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
#!/bin/sh | |
if grep -r --include \*.js "function(" ./app | |
then | |
echo "Put a space after the function keyword!" | |
echo "Run the following command in app directory to fix:"; | |
echo "find . -name \"*.js\" -print0 | xargs -0 sed -i -e 's/function(/function (/g'" | |
exit 1; | |
else | |
exit 0; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment