add windows support

This commit is contained in:
crazywhalecc
2024-01-10 21:08:25 +08:00
committed by Jerry Ma
parent 5f8641f417
commit 104778d17a
39 changed files with 1166 additions and 230 deletions

View File

@@ -87,6 +87,10 @@ class MicroCombineCommand extends BaseCommand
// 8. Combine !
$output = FileSystem::isRelativePath($output) ? (WORKING_DIR . '/' . $output) : $output;
$file_target = file_get_contents($micro_file) . $ini_part . file_get_contents($file);
if (PHP_OS_FAMILY === 'Windows' && !str_ends_with(strtolower($output), '.exe')) {
$output .= '.exe';
}
$output = FileSystem::convertPath($output);
$result = file_put_contents($output, $file_target);
if ($result === false) {
$this->output->writeln('<error>Combine failed.</error>');