setName('admin:update') ->addOption('reinstall', null, Option::VALUE_NONE, '重装版本') ->addOption('update-ulthon', null, Option::VALUE_NONE, '更新 ulthon_admin') ->addOption('update-master', null, Option::VALUE_NONE, '更新 ulthon_admin 的 master 分支') ->addOption('dry-run', null, Option::VALUE_NONE, '预览模式,只输出变更不执行') ->setDescription('更新系统代码'); } protected function execute(Input $input, Output $output) { // 指令输出 $output->writeln('admin:update'); $repo = static::REPO; if ((bool)$input->getOption('update-ulthon')) { $repo = 'ulthon_admin'; } $update_service = new AdminUpdateService($repo); $update_service->input = $input; $update_service->output = $output; $update_service->dryRun = (bool)$input->getOption('dry-run'); $update_service->update(); } }