From f927f153a869794c91c52b0a7eead992118fc450 Mon Sep 17 00:00:00 2001 From: helloplhm-qwq Date: Wed, 31 Jan 2024 23:57:58 +0800 Subject: [PATCH] =?UTF-8?q?build:=20[release]=20=E6=88=91=E6=9D=A5?= =?UTF-8?q?=E5=88=B7=E7=89=88=E6=9C=AC=E5=8F=B7=E8=BE=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build.py b/build.py index 88b538b..7b6b11e 100644 --- a/build.py +++ b/build.py @@ -10,10 +10,15 @@ def get_latest_tag(): return t[-1] if (t[-1] != toml.load("./pyproject.toml")["tool"]["poetry"]["version"]) else t[-2] def get_specified_tag(index): - return subprocess.check_output(['git', 'tag']).decode('utf-8').strip().split("\n")[index] + r = subprocess.check_output(['git', 'tag']).decode('utf-8').strip().split("\n") + n = [] + for i in r: + if (i): + n.append(i.strip()) + return n[index] def get_changelog(): - cmd = ['git', 'log', f'{toml.load("./pyproject.toml")["tool"]["poetry"]["version"]}..HEAD', '--pretty=format:"%h %s"'] + cmd = ['git', 'log', f'{get_specified_tag(-1)}..HEAD', '--pretty=format:"%h %s"'] print(cmd) res = subprocess.check_output(cmd).decode('utf-8').strip() res = res.split('\n')