fix plugin:make autoload bug

This commit is contained in:
crazywhalecc
2023-05-20 19:01:55 +08:00
committed by Jerry Ma
parent 6cc45aed43
commit 7f0761e545
2 changed files with 3 additions and 2 deletions

View File

@@ -83,7 +83,8 @@ class PluginGenerator
// TODO: 寻找 PHP 运行环境和 Composer 是否在当前目录的情况
chdir($plugin_base_dir);
$env = ZMUtil::getComposerExecutable();
passthru(PHP_BINARY . ' ' . escapeshellcmd($env) . ' dump-autoload');
$cmd = $env === 'composer' ? $env . ' dump-autoload' : PHP_BINARY . ' ' . escapeshellcmd($env) . ' dump-autoload';
passthru($cmd);
chdir(WORKING_DIR);
return $plugin_base_dir;
}