Skip to content

Commit

Permalink
Merge pull request #3929 from najdanovicivan/pre-commit-hook
Browse files Browse the repository at this point in the history
Fix Pre-Commit on windows Closes #3920
  • Loading branch information
samsonasik authored Nov 27, 2020
2 parents 3251999 + 3cc32de commit fff69b0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions admin/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ if [ "$FILES" != "" ]
then
echo "Running PHPStan..."
# Run on whole codebase
php ./vendor/bin/phpstan analyse
if [ -d /proc/cygdrive ]
then
./vendor/bin/phpstan analyse
else
php ./vendor/bin/phpstan analyse
fi

if [ $? != 0 ]
then
Expand All @@ -47,7 +52,12 @@ fi
if [ "$FILES" != "" ]
then
echo "Running Code Sniffer..."
php ./vendor/bin/phpcbf --standard=./vendor/codeigniter4/codeigniter4-standard/CodeIgniter4 --encoding=utf-8 -n -p $FILES
if [ -d /proc/cygdrive ]
then
./vendor/bin/phpcbf --standard=./vendor/codeigniter4/codeigniter4-standard/CodeIgniter4 --encoding=utf-8 -n -p $FILES
else
php ./vendor/bin/phpcbf --standard=./vendor/codeigniter4/codeigniter4-standard/CodeIgniter4 --encoding=utf-8 -n -p $FILES
fi
fi

exit $?

0 comments on commit fff69b0

Please sign in to comment.