Files
meteor/scripts/admin/git-hooks/pre-commit
Sashko Stubailo 3bed8f6a62 Add a git hook copying mechanism to meteor tool
Introduce the first hook - ESLint for the tool
2015-06-24 14:54:55 -07:00

27 lines
581 B
Bash
Executable File

#!/bin/sh
cd $(dirname $0)
cd ../..
# If you want to allow linter errors set this variable to true.
eslint=$(git config hooks.ignore-eslint)
echo "Linting Meteor tool code..."
./scripts/admin/eslint/eslint.sh
linter_exit_code=$?
if [ "$eslint" != "true" ] && [ $linter_exit_code != 0 ]
then
echo "Linter errors detected in pre-commit hook."
echo
echo "Run the linter with ./scripts/admin/eslint/eslint.sh"
echo
echo "If you know what you are doing you can disable this"
echo "check using:"
echo
echo " git config hooks.ignore-eslint true"
echo
exit 1
fi