Open richaber opened 7 months ago
If there is a space character in the path to the PHP_BINARY, phpcs-diff will fail. Presumably other unescaped but valid path characters would have the same effect.
PHP_BINARY
phpcs-diff
Path to the PHP_BINARY in my environment (macOS)...
'/Users/user_name/Library/Application Support/Local/lightning-services/php-8.0.30+0/bin/darwin-arm64/bin/php'
The phpcs-diff failure looks like this...
$ ./vendor/bin/phpcs-diff master sh: /Users/user_name/Library/Application: No such file or directory Unable to run phpcs executable.
I am able to resolve this for my environment by using escapeshellarg on PHP_BINARY at line 220 of \PhpcsDiff\PhpcsDiff::runPhpcs() like so...
escapeshellarg
\PhpcsDiff\PhpcsDiff::runPhpcs()
$exec = escapeshellarg( PHP_BINARY ) . ' ' . $exec;
Thanks @richaber, did you want to attempt to raise a pull-request for this? If not, I'll get this change pushed and tagged before the end of the week.
If there is a space character in the path to the
PHP_BINARY
,phpcs-diff
will fail. Presumably other unescaped but valid path characters would have the same effect.Path to the
PHP_BINARY
in my environment (macOS)...The
phpcs-diff
failure looks like this...I am able to resolve this for my environment by using
escapeshellarg
onPHP_BINARY
at line 220 of\PhpcsDiff\PhpcsDiff::runPhpcs()
like so...