Already in hooks

This commit is contained in:
Dennis Eichhorn 2017-10-26 11:02:46 +02:00 committed by GitHub
parent dda922024d
commit de8d17b107

View File

@ -1,13 +0,0 @@
#!/bin/bash
git diff --cached --name-only | while read FILE; do
if [[ "$FILE" =~ ^.+(php)$ ]]; then
if [[ -f ${FILE} ]]; then
php -l "$FILE" 1> /dev/null
if [ $? -ne 0 ]; then
echo -e "\e[1;31m\tAborting commit due to files with syntax errors.\e[0m" >&2
exit 1
fi
fi
fi
done || exit $?