feat: 增强下载错误提示和更新成功提示的可视化反馈
This commit is contained in:
@@ -8,7 +8,7 @@ def download_file(url):
|
|||||||
"""使用 curl 下载文件内容"""
|
"""使用 curl 下载文件内容"""
|
||||||
result = subprocess.run(["curl", "-s", url], capture_output=True, text=True)
|
result = subprocess.run(["curl", "-s", url], capture_output=True, text=True)
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
print(f"下载 {url} 时出错,跳过。")
|
print(f"❌ 下载 {url} 时出错,跳过。")
|
||||||
return None
|
return None
|
||||||
return result.stdout
|
return result.stdout
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ def main():
|
|||||||
|
|
||||||
with open(rel_path, "w", encoding="utf-8") as f:
|
with open(rel_path, "w", encoding="utf-8") as f:
|
||||||
f.write(new_content)
|
f.write(new_content)
|
||||||
print(f"更新了 {rel_path}")
|
print(f"🚀 更新了 {rel_path}")
|
||||||
modified = True
|
modified = True
|
||||||
|
|
||||||
# 如果有修改则提交到仓库
|
# 如果有修改则提交到仓库
|
||||||
|
|||||||
Reference in New Issue
Block a user