From 3cc32dedcd532591fd9dc3da4fc9227c94805575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Najdanovic=CC=81=20Ivan?= Date: Thu, 26 Nov 2020 19:18:07 +0100 Subject: [PATCH] Fix Pre-Commit on windows Attempt to Fix #3920 --- admin/pre-commit | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/admin/pre-commit b/admin/pre-commit index c285add3f81e..94665c1ed4a5 100644 --- a/admin/pre-commit +++ b/admin/pre-commit @@ -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 @@ -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 $?