2018-09-21 13:06:16 +00:00
|
|
|
#!/usr/bin/env bash
|
2021-02-01 02:24:11 +00:00
|
|
|
PHP_FILES_CHANGED=""
|
2018-09-21 13:06:16 +00:00
|
|
|
|
2021-02-01 02:24:11 +00:00
|
|
|
for FILE in $(echo $CHANGED_FILES | tr ',' '\n')
|
|
|
|
do
|
|
|
|
if [[ $FILE =~ ".php" ]]; then
|
2021-08-18 18:15:58 +00:00
|
|
|
PHP_FILES_CHANGED+="$FILE "
|
2021-02-01 02:24:11 +00:00
|
|
|
fi
|
|
|
|
done
|
2018-09-21 13:06:16 +00:00
|
|
|
|
2021-02-01 02:24:11 +00:00
|
|
|
if [ "$PHP_FILES_CHANGED" != "" ]; then
|
|
|
|
composer install
|
|
|
|
echo "Running Code Sniffer."
|
|
|
|
./vendor/bin/phpcs --encoding=utf-8 -n -p $PHP_FILES_CHANGED
|
|
|
|
else
|
|
|
|
echo "No changed files detected, sniffer not run."
|
2018-09-21 13:06:16 +00:00
|
|
|
fi
|
2021-02-01 02:24:11 +00:00
|
|
|
|