mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-09 19:42:47 +08:00
优化输出
This commit is contained in:
@@ -11,6 +11,7 @@ use League\Flysystem\Local\LocalFilesystemAdapter;
|
|||||||
use League\Flysystem\StorageAttributes;
|
use League\Flysystem\StorageAttributes;
|
||||||
use think\console\Command;
|
use think\console\Command;
|
||||||
use think\console\Input;
|
use think\console\Input;
|
||||||
|
use think\console\input\Option;
|
||||||
use think\console\Output;
|
use think\console\Output;
|
||||||
use think\facade\App;
|
use think\facade\App;
|
||||||
use think\facade\Env;
|
use think\facade\Env;
|
||||||
@@ -23,6 +24,7 @@ class Update extends Command
|
|||||||
{
|
{
|
||||||
// 指令配置
|
// 指令配置
|
||||||
$this->setName('admin:update')
|
$this->setName('admin:update')
|
||||||
|
->addOption('show-diff', null, Option::VALUE_NONE, 'show changed files diff')
|
||||||
->setDescription('the admin:update command');
|
->setDescription('the admin:update command');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,10 +148,12 @@ class Update extends Command
|
|||||||
foreach ($changed_files as $file_path => $compare_result) {
|
foreach ($changed_files as $file_path => $compare_result) {
|
||||||
$output->warning($file_path);
|
$output->warning($file_path);
|
||||||
|
|
||||||
|
if ($input->hasOption('show-diff')) {
|
||||||
if (is_string($compare_result)) {
|
if (is_string($compare_result)) {
|
||||||
$output->writeln($compare_result);
|
$output->writeln($compare_result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$file_count = count($changed_files);
|
$file_count = count($changed_files);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user