解决commits存在换行时报错 #177
Some checks failed
build Rule / execute_python_script (push) Has been cancelled

This commit is contained in:
Elysia 2025-10-10 16:48:19 +08:00
parent 1e3b857731
commit 8c7be33bce
No known key found for this signature in database
GPG Key ID: 0B5B67E3895175F9

View File

@ -23,12 +23,13 @@ def WriteFile(name, text, suffix, comment, module_total): # 写入文件
if comment != "":
now = datetime.now()
commits = subprocess.check_output(['git', 'log', '-1', '--pretty=%B']).decode('utf-8').strip().replace('\n', '\\n')
title = f"""{comment}Title: AWAvenue Ads Rule
{comment}--------------------------------------
{comment}Total lines: {module_total}
{comment}Version: {get_latest_git_tag()}
{comment}Update time: {now.strftime("%Y-%m-%d %H:%M:%S")} UTC+8
{comment}Update content: {subprocess.check_output(['git', 'log', '-1', '--pretty=%B']).strip().decode('utf-8')}
{comment}Update content: {commits}
{comment}Homepage: https://github.com/TG-Twilight/AWAvenue-Ads-Rule
{comment}License: https://github.com/TG-Twilight/AWAvenue-Ads-Rule/blob/main/LICENSE