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,7 +24,8 @@ class Update extends Command
|
|||||||
{
|
{
|
||||||
// 指令配置
|
// 指令配置
|
||||||
$this->setName('admin:update')
|
$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)
|
protected function execute(Input $input, Output $output)
|
||||||
@@ -146,8 +148,10 @@ 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 (is_string($compare_result)) {
|
if ($input->hasOption('show-diff')) {
|
||||||
$output->writeln($compare_result);
|
if (is_string($compare_result)) {
|
||||||
|
$output->writeln($compare_result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user