diff --git a/extend/base/admin/service/AdminUpdateServiceBase.php b/extend/base/admin/service/AdminUpdateServiceBase.php index a05d5ca..3b76f10 100644 --- a/extend/base/admin/service/AdminUpdateServiceBase.php +++ b/extend/base/admin/service/AdminUpdateServiceBase.php @@ -27,6 +27,11 @@ class AdminUpdateServiceBase public $dryRun = false; + public $optionalConflict = null; // null=未指定(走交互), skip|overwrite|ask + public $forceConflict = null; // null=未指定(走交互), overwrite|skip|ask + public $showScope = null; // null=未指定(默认all), all|conflict + public $skippedConflictFiles = []; // [file_path => ['type' => 'add|delete|update', 'category' => 'optional|force']] + /** * @var Input */ diff --git a/extend/base/common/command/admin/UpdateBase.php b/extend/base/common/command/admin/UpdateBase.php index ae5f522..217ef16 100644 --- a/extend/base/common/command/admin/UpdateBase.php +++ b/extend/base/common/command/admin/UpdateBase.php @@ -25,6 +25,9 @@ class UpdateBase extends Command ->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, '预览模式,只输出变更不执行') + ->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') ->setDescription('更新系统代码'); } @@ -43,6 +46,9 @@ class UpdateBase extends Command $update_service->input = $input; $update_service->output = $output; $update_service->dryRun = (bool)$input->getOption('dry-run'); + $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->update(); }