Difficult-Rocket/after_compile.py

19 lines
546 B
Python
Raw Normal View History

2022-12-29 11:15:00 +08:00
# -------------------------------
# Difficult Rocket
# Copyright © 2021-2022 by shenjackyuanjie 3695888@qq.com
# All rights reserved
# -------------------------------
import os
2022-12-29 12:08:08 +08:00
import zipfile
2022-12-29 11:15:00 +08:00
print(os.listdir('./build'))
2022-12-29 12:08:08 +08:00
with zipfile.ZipFile('./build/main.zip', 'w', zipfile.ZIP_DEFLATED, compresslevel=9) as dist_zip:
for path, sub_paths, sub_files in os.walk('./build/DR.dist'):
2022-12-29 12:14:51 +08:00
print(f'writing {path}')
2022-12-29 12:08:08 +08:00
for file in sub_files:
file_path = os.path.join(path, file)
dist_zip.write(file_path)