// abort when we reach the home dir or top of the filesystem
while (dirname($dir) !== $dir && $dir !== $home) {
if (file_exists($dir.'/composer.json')) {
if ($io->askConfirmation('<info>No composer.json in current directory, do you want to use the one at '.$dir.'?</info> [<comment>Y,n</comment>]? ', true)) {
$oldWorkingDir = getcwd();
chdir($dir);
}
break;
}
$dir = dirname($dir);
}
}
if (!$this->disablePluginsByDefault && !$this->hasPluginCommands && 'global' !== $commandName) {
if (!$this->disablePluginsByDefault && !$this->hasPluginCommands && 'global' !== $commandName) {
try {
try {
foreach ($this->getPluginCommands() as $command) {
foreach ($this->getPluginCommands() as $command) {