Check if PHPCS is installed before trying to install a new copy
This commit is contained in:
parent
cbfe4bd595
commit
7fdf209713
|
@ -5,6 +5,11 @@ if [[ ${RUN_PHPCS} == 1 ]]; then
|
||||||
IGNORE="tests/cli/,includes/libraries/,includes/api/legacy/"
|
IGNORE="tests/cli/,includes/libraries/,includes/api/legacy/"
|
||||||
|
|
||||||
if [ "$CHANGED_FILES" != "" ]; then
|
if [ "$CHANGED_FILES" != "" ]; then
|
||||||
|
if [ ! -f "./vendor/bin/phpcs" ]; then
|
||||||
|
# Install wpcs globally
|
||||||
|
composer require woocommerce/woocommerce-sniffs
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Running Code Sniffer."
|
echo "Running Code Sniffer."
|
||||||
./vendor/bin/phpcs --ignore=$IGNORE --encoding=utf-8 -s -n -p $CHANGED_FILES
|
./vendor/bin/phpcs --ignore=$IGNORE --encoding=utf-8 -s -n -p $CHANGED_FILES
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue