发布新版本;增加自动替换脚本

This commit is contained in:
2023-12-08 14:09:13 +08:00
parent 89c0961cbc
commit 9f2d0898ec
9 changed files with 232 additions and 2 deletions

View File

@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace base\common\command\admin;
use app\admin\service\AdminUpdateCodeService;
use think\console\Command;
use think\console\Input;
use think\console\input\Option;
use think\console\Output;
class UpdateCodeBase extends Command
{
protected function configure()
{
// 指令配置
$this->setName('admin:update:code')
->addOption('update-version', null, Option::VALUE_REQUIRED, '按指定版本的规则更新现有代码')
->setDescription('the admin:update:code command');
}
protected function execute(Input $input, Output $output)
{
// 指令输出
$update_version = $input->getOption('update-version');
if(is_null($update_version)){
$output->error('请指定更新的版本号');
return;
}
$update_service = new AdminUpdateCodeService();
$update_service->input = $input;
$update_service->output = $output;
$update_service->update($update_version);
}
}