From 2e3fac93f04e35d4dc1de426e971424d285f1828 Mon Sep 17 00:00:00 2001 From: augushong Date: Mon, 25 May 2026 22:41:08 +0800 Subject: [PATCH] =?UTF-8?q?feat(update):=20=E6=B3=A8=E5=86=8C=E5=86=B2?= =?UTF-8?q?=E7=AA=81=E7=AD=96=E7=95=A5=E5=92=8C=E8=BE=93=E5=87=BA=E8=8C=83?= =?UTF-8?q?=E5=9B=B4=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/base/admin/service/AdminUpdateServiceBase.php | 5 +++++ extend/base/common/command/admin/UpdateBase.php | 6 ++++++ 2 files changed, 11 insertions(+) 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(); }