Adding the ability to use a project's composer bin directory even if it isn't defined in the composer.json (/vendor/bin)

This commit is contained in:
Dan Cryer 2014-07-29 16:23:48 +01:00
parent 7137e3921f
commit b6e7624bf6

View file

@ -170,8 +170,11 @@ abstract class BaseCommandExecutor implements CommandExecutor
$composer = $path.'/composer.json';
if (is_file($composer)) {
$json = json_decode(file_get_contents($composer));
if (isset($json->config->{"bin-dir"})) {
return $path.'/'.$json->config->{"bin-dir"};
} elseif (is_dir($path . '/vendor/bin')) {
return $path . '/vendor/bin';
}
}
}