From f1580eb4172f6a7565402c88e1fd44cbaebcec61 Mon Sep 17 00:00:00 2001 From: augushong Date: Mon, 18 Jul 2022 09:53:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99=E7=89=88=E6=9C=AC=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8=E6=8E=A8=E9=80=81=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/command/admin/Version.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/app/common/command/admin/Version.php b/app/common/command/admin/Version.php index 5b5dd66..661a376 100644 --- a/app/common/command/admin/Version.php +++ b/app/common/command/admin/Version.php @@ -1,5 +1,6 @@ setName('admin:version') + ->addOption('push-tag', null, Option::VALUE_NONE, '使用git命令生成tag并推送') ->setDescription('查看当前ulthon_admin的版本号'); } protected function execute(Input $input, Output $output) { + // 指令输出 - $output->info('当前版本号为:'.$this::VERSION); + $output->info('当前版本号为:' . $this::VERSION); $output->writeln('当前的修改说明:'); $output->writeln('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>'); - + foreach ($this::COMMENT as $comment) { $output->info($comment); } @@ -40,9 +44,17 @@ class Version extends Command $output->highlight('代码托管地址:https://gitee.com/ulthon/ulthon_admin'); $output->highlight('开发文档地址:http://doc.ulthon.com/home/read/ulthon_admin/home.html'); - + $is_push_tag = $input->hasOption('push-tag'); + if ($is_push_tag) { + $root_path = App::getRootPath(); + $version = $this::VERSION; + $comment = implode(';', $this::COMMENT); + exec("git tag -a $version -m \"$comment\""); + + exec("git push --tags"); + } } }