为基于框架的产品预留更新机制;

This commit is contained in:
augushong
2024-10-14 18:01:10 +08:00
parent 090ab096c0
commit 40a00be9d6
4 changed files with 48 additions and 19 deletions

View File

@@ -12,11 +12,15 @@ use think\console\Output;
class UpdateBase extends Command
{
public const REPO = null;
protected function configure()
{
// 指令配置
$this->setName('admin:update')
->addOption('reinstall', null, Option::VALUE_NONE, '重装版本')
->addOption('update-ulthon', null, Option::VALUE_NONE, '重装版本')
->setDescription('the admin:update command');
}
@@ -25,7 +29,13 @@ class UpdateBase extends Command
// 指令输出
$output->writeln('admin:update');
$update_service = new AdminUpdateService();
$repo = static::REPO;
if($input->hasOption('update-ulthon')){
$repo = null;
}
$update_service = new AdminUpdateService($repo);
$update_service->input = $input;
$update_service->output = $output;
$update_service->update();