feat(update): 新增 --keep-repo 参数,dry-run 模式下保留上游克隆目录便于对比

This commit is contained in:
augushong
2026-05-26 21:38:16 +08:00
parent 58d87d9980
commit 3f8f79b445
3 changed files with 68 additions and 2 deletions

View File

@@ -28,6 +28,7 @@ class UpdateBase extends Command
->addOption('optional-conflict', null, Option::VALUE_OPTIONAL, '可选文件冲突处理策略: skip|overwrite|ask')
->addOption('force-conflict', null, Option::VALUE_OPTIONAL, '强制文件冲突处理策略: overwrite|skip|ask')
->addOption('show', null, Option::VALUE_OPTIONAL, '变更输出范围: all|conflict')
->addOption('keep-repo', null, Option::VALUE_NONE, '预览模式下保留上游克隆目录,便于手动对比跳过的文件')
->setDescription('更新系统代码');
}
@@ -49,6 +50,7 @@ class UpdateBase extends Command
$update_service->optionalConflict = $input->getOption('optional-conflict') ?: null;
$update_service->forceConflict = $input->getOption('force-conflict') ?: null;
$update_service->showScope = $input->getOption('show') ?: null;
$update_service->keepRepo = (bool)$input->getOption('keep-repo');
$update_service->update();
}