Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 25c805e

Browse files
oleg-andreyevnicolas-grekas
authored andcommitted
[PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script
1 parent 4b419f2 commit 25c805e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ foreach ($defaultEnvs as $envName => $envValue) {
6060
$COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar')
6161
|| ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar 2> /dev/null`))
6262
|| ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer`) : `which composer 2> /dev/null`))
63-
? $PHP.' '.escapeshellarg($COMPOSER)
63+
? (file_get_contents($COMPOSER, null, 0, 18) === '#!/usr/bin/env php' ? $PHP : '').' '.escapeshellarg($COMPOSER) // detect shell wrappers by looking at the shebang
6464
: 'composer';
6565

6666
if (false === $SYMFONY_PHPUNIT_REMOVE = getenv('SYMFONY_PHPUNIT_REMOVE')) {

0 commit comments

Comments
 (0)