woocommerce/plugins/woocommerce-admin/bin/phpcs.sh

19 lines
380 B
Bash
Raw Normal View History

2018-09-21 13:06:16 +00:00
#!/usr/bin/env bash
PHP_FILES_CHANGED=""
2018-09-21 13:06:16 +00:00
for FILE in $(echo $CHANGED_FILES | tr ',' '\n')
do
if [[ $FILE =~ ".php" ]]; then
PHP_FILES_CHANGED += "$FILE,"
fi
done
2018-09-21 13:06:16 +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