From 658b535436dcb37c68e0807a3b285031656ee0b0 Mon Sep 17 00:00:00 2001 From: sebastian kessler Date: Mon, 29 Aug 2022 09:12:03 +0200 Subject: [PATCH] fix for composer 2 compatability --- bin/php-code-validator | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/php-code-validator b/bin/php-code-validator index addc6ba..47d4950 100755 --- a/bin/php-code-validator +++ b/bin/php-code-validator @@ -1,8 +1,10 @@ #!/bin/bash -CALLER_DIR=$(pwd) -cd $(dirname $0) -BIN_DIR=$(pwd) -cd ${CALLER_DIR} + +if [[ -z "$COMPOSER_RUNTIME_BIN_DIR" ]]; then + BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +else + BIN_DIR="$COMPOSER_RUNTIME_BIN_DIR" +fi # used within project if [ -f ${BIN_DIR}/phpcs ]; then