From abda9e4ee8759e299505869d62c4ddabb970cf0c Mon Sep 17 00:00:00 2001 From: Bruno Fontes Date: Thu, 11 Feb 2021 18:29:32 -0300 Subject: [PATCH] Fix the pre-push hook error with different phpunit versions Now the pre-push hook check first for a composer phpunit, it not found, try to use a system wide one. If none of them are available, it will rise an error --- pre-push.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pre-push.sh b/pre-push.sh index 3db4291..1a9b5c5 100755 --- a/pre-push.sh +++ b/pre-push.sh @@ -1,10 +1,10 @@ params="--bootstrap vendor/autoload.php tests --testdox --color" -if [ $(command -v phpunit) ]; then - phpunit $params +if [ -d ./vendor/phpunit ]; then + ./vendor/phpunit/phpunit/phpunit $params else - if [ -d ./vendor/phpunit ]; then - ./vendor/phpunit/phpunit/phpunit $params + if [ $(command -v phpunit) ]; then + phpunit $params else echo "Please, run 'make install' or install phpunit globally to run the tests" fi