From 0b23e0a94065a0da4a8103538881e0527484a9d4 Mon Sep 17 00:00:00 2001 From: augushong Date: Wed, 20 Sep 2023 11:39:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/command/admin/Update.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/common/command/admin/Update.php b/app/common/command/admin/Update.php index c770fa9..70e3d5b 100644 --- a/app/common/command/admin/Update.php +++ b/app/common/command/admin/Update.php @@ -11,6 +11,7 @@ use League\Flysystem\Local\LocalFilesystemAdapter; use League\Flysystem\StorageAttributes; use think\console\Command; use think\console\Input; +use think\console\input\Option; use think\console\Output; use think\facade\App; use think\facade\Env; @@ -23,7 +24,8 @@ class Update extends Command { // 指令配置 $this->setName('admin:update') - ->setDescription('the admin:update command'); + ->addOption('show-diff', null, Option::VALUE_NONE, 'show changed files diff') + ->setDescription('the admin:update command'); } protected function execute(Input $input, Output $output) @@ -146,8 +148,10 @@ class Update extends Command foreach ($changed_files as $file_path => $compare_result) { $output->warning($file_path); - if (is_string($compare_result)) { - $output->writeln($compare_result); + if ($input->hasOption('show-diff')) { + if (is_string($compare_result)) { + $output->writeln($compare_result); + } } }