修改.h覆盖问题

This commit is contained in:
2025-10-18 23:55:43 +08:00
parent 7127b207f8
commit 49545dd232
5 changed files with 52 additions and 8 deletions

View File

@@ -1243,7 +1243,9 @@ class bsp(QWidget):
dst_bsp_h = os.path.join(project_path, "User/bsp/bsp.h")
os.makedirs(os.path.dirname(dst_bsp_h), exist_ok=True)
if os.path.exists(src_bsp_h):
shutil.copyfile(src_bsp_h, dst_bsp_h)
with open(src_bsp_h, 'r', encoding='utf-8') as f:
content = f.read()
save_with_preserve(dst_bsp_h, content)
total = 0
success_count = 0