mirror of
https://github.com/Karaka-Management/Build.git
synced 2026-01-15 05:18:40 +00:00
13 lines
402 B
Bash
13 lines
402 B
Bash
git diff --cached --name-only | while read FILE; do
|
|
if [[ "$FILE" =~ ^.+(php|inc|module|install|test)$ ]]; then
|
|
# Courtesy of swytsh from the comments below.
|
|
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 $?
|