fix built-in composer not working with init command

This commit is contained in:
crazywhalecc
2023-02-12 19:26:19 +08:00
committed by Jerry
parent fe332eb8f2
commit f63923a792
2 changed files with 12 additions and 2 deletions

View File

@@ -41,6 +41,11 @@ final class ConsoleApplication extends Application
FileSystem::getClassesPsr4(SOURCE_ROOT_DIR . '/src/Command', 'Command')
);
}
// 初始化 Composer 变量
if (file_exists(WORKING_DIR . '/runtime/composer.phar')) {
echo '* Using native composer' . PHP_EOL;
putenv('COMPOSER_EXECUTABLE=' . WORKING_DIR . '/runtime/composer.phar');
}
$commands = [];
foreach ($command_classes as $command_class) {
try {