Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pre Commit Hook for Shopware Plugin
#!/bin/sh
CWD=$(pwd)
STATUS=0
echo "Running PHPCS"
if [ -f $CWD/bin/php-cs-fixer ]
then
$CWD/bin/php-cs-fixer fix --dry-run --allow-risky=yes --config=$CWD/.php_cs.dist
if [ $? -ne 0 ]
then
echo "PHPCS has failed - commit aborted"
STATUS=1
fi
fi
exit $STATUS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment