feat(update): 新增 --dry-run 预览模式

This commit is contained in:
augushong
2026-05-25 21:35:47 +08:00
parent fb3f807877
commit a17ba88068
2 changed files with 60 additions and 34 deletions

View File

@@ -24,6 +24,7 @@ class UpdateBase extends Command
->addOption('reinstall', null, Option::VALUE_NONE, '重装版本')
->addOption('update-ulthon', null, Option::VALUE_NONE, '更新 ulthon_admin')
->addOption('update-master', null, Option::VALUE_NONE, '更新 ulthon_admin 的 master 分支')
->addOption('dry-run', null, Option::VALUE_NONE, '预览模式,只输出变更不执行')
->setDescription('更新系统代码');
}
@@ -41,6 +42,7 @@ class UpdateBase extends Command
$update_service = new AdminUpdateService($repo);
$update_service->input = $input;
$update_service->output = $output;
$update_service->dryRun = (bool)$input->getOption('dry-run');
$update_service->update();
}