重构打包配置,使用新的spec文件生成单个exe文件 修复日志处理中可能存在的None值问题 添加clean.py脚本用于清理打包残留文件 更新SKILL.md文档说明打包流程
17 lines
529 B
Python
17 lines
529 B
Python
import os
|
||
import shutil
|
||
import glob
|
||
import subprocess
|
||
|
||
# 2. 清理打包残留文件 等价:rd /s /q build + del /f *.spec
|
||
print("开始清理打包残留文件...")
|
||
# 删除build文件夹
|
||
if os.path.exists("build") and os.path.isdir("build"):
|
||
shutil.rmtree("build")
|
||
# 删除所有.spec文件
|
||
spec_files = glob.glob("*.spec")
|
||
for spec_file in spec_files:
|
||
if os.path.exists(spec_file):
|
||
os.remove(spec_file)
|
||
|
||
print("✅ 打包完成 + 残留文件清理完毕!exe文件已生成在当前目录") |