From 276cbd6aa171fcef2c9034e8e95efb642eb72a97 Mon Sep 17 00:00:00 2001 From: scdhh <51957264+shoucandanghehe@users.noreply.github.com> Date: Fri, 13 Aug 2021 01:54:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9updateConfVersion.py=20>=20?= =?UTF-8?q?=E5=9C=A8ci=E8=BF=90=E8=A1=8C=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B8=B8=E6=88=8F=E5=AD=98=E6=A1=A3=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=20(#202)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修改updateConfVersion.py * 添加更新conf.lua时修改存档目录的步骤 --- .github/workflows/updateConfVersion.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/updateConfVersion.py b/.github/workflows/updateConfVersion.py index 3537a019..128d3244 100644 --- a/.github/workflows/updateConfVersion.py +++ b/.github/workflows/updateConfVersion.py @@ -1,12 +1,16 @@ import argparse if __name__ == "__main__": - parser = argparse.ArgumentParser(description="用于更新conf.lua内编译版本号") - parser.add_argument("-H", "--Hash", type=str, help = "Github提交Hash") + parser = argparse.ArgumentParser(description="用于更新conf.lua") + parser.add_argument("-H", "--Hash", type=str, default = False, help = "Github提交Hash") args = parser.parse_args() with open("conf.lua", "r+", encoding="utf-8") as file: data = file.read() - data = data.replace('@DEV', f'@{args.Hash[0:4]}') + if args.Hash != False: + data = data.replace('@DEV', f'@{args.Hash[0:4]}') + data = data.replace("t.identity='Techmino'--Saving folder", "t.identity='Techmino_Snapshot'--Saving folder") + else: + data = data.replace('@DEV', '') file.seek(0) file.truncate() file.flush()