LunaHook-mirror/scripts/pack.py

35 lines
1005 B
Python
Raw Normal View History

2024-04-26 16:45:45 +08:00
import os, shutil, sys
2024-11-02 15:26:54 +08:00
os.chdir(os.path.dirname(__file__))
2024-04-26 16:45:45 +08:00
for f in os.listdir("../builds"):
if os.path.isdir("../builds/" + f) == False:
continue
for dirname, _, fs in os.walk("../builds/" + f):
if (
dirname.endswith("translations")
or dirname.endswith("translations")
or dirname.endswith("imageformats")
or dirname.endswith("iconengines")
or dirname.endswith("bearer")
):
2024-04-21 17:38:47 +08:00
shutil.rmtree(dirname)
continue
for ff in fs:
2024-04-26 16:45:45 +08:00
path = os.path.join(dirname, ff)
if ff in [
"Qt5Svg.dll",
"libEGL.dll",
"libGLESv2.dll",
"opengl32sw.dll",
"D3Dcompiler_47.dll",
]:
os.remove(path)
targetdir = "../builds/" + f
2024-04-26 19:06:02 +08:00
target = "../builds/" + f + ".zip"
2024-11-02 15:26:54 +08:00
os.system(
rf'"C:\Program Files\7-Zip\7z.exe" a -m0=Deflate -mx9 {target} {targetdir}'
)