friendica-github/util/lint.sh
Roland Häder e06cac420b Use [] instead of test.
Signed-off-by: Roland Häder <roland@mxchange.org>
2016-12-19 14:23:09 +01:00

17 lines
403 B
Bash
Executable file

#!/bin/sh
if [ ! -e "index.php" ]
then
echo "$0: Please execute this script from root directory."
exit 1
fi
echo "$0: Analysing PHP scripts for syntax errors (lint) ..."
LINT=`find -type f -name "*.php" -exec php -l -f {} 2>&1 \; | grep -v "No syntax errors detected in" | grep -v "FUSE_EDEADLK" | sort --unique`
if [ -n "${LINT}" ]
then
echo "${LINT}"
else
echo "$0: No syntax errors found."
fi