* 删除不需要的re模块 * 添加编译过程中向源码添加提交hash的步骤 * 修正变量 * 整理代码
This commit is contained in:
13
.github/workflows/updateConfVersion.py
vendored
Normal file
13
.github/workflows/updateConfVersion.py
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import argparse
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="用于更新conf.lua内编译版本号")
|
||||
parser.add_argument("-H", "--Hash", type=str, 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]}')
|
||||
file.seek(0)
|
||||
file.truncate()
|
||||
file.flush()
|
||||
file.write(data)
|
||||
Reference in New Issue
Block a user