Check if PHPCS is installed before trying to install a new copy

This commit is contained in:
Claudio Sanches 2020-08-11 20:08:28 -03:00
parent cbfe4bd595
commit 7fdf209713
1 changed files with 5 additions and 0 deletions

View File

@ -5,6 +5,11 @@ if [[ ${RUN_PHPCS} == 1 ]]; then
IGNORE="tests/cli/,includes/libraries/,includes/api/legacy/"
if [ "$CHANGED_FILES" != "" ]; then
if [ ! -f "./vendor/bin/phpcs" ]; then
# Install wpcs globally
composer require woocommerce/woocommerce-sniffs
fi
echo "Running Code Sniffer."
./vendor/bin/phpcs --ignore=$IGNORE --encoding=utf-8 -s -n -p $CHANGED_FILES
fi