Skip to content

Commit

Permalink
fix depend
Browse files Browse the repository at this point in the history
  • Loading branch information
lilingfengdev committed Jun 28, 2024
1 parent 0891129 commit 43ad484
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions generate-bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
import platform

if platform.system() == 'Windows':
os.system("python3 -m pip install pyyaml install-jdk tqdm psutil requests pygithub "
os.system("python3 -m pip install pyyaml install-jdk tqdm psutil requests pygithub imageio "
"rtoml-0.10.0-cp311-none-win_amd64.whl nuitka")
urllib.request.urlretrieve("https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-win64.zip",
"upx.zip")
zip = zipfile.ZipFile("upx.zip")
zip.extract("upx-4.2.4-win64/upx.exe", path=os.getcwd())
shutil.move("upx-4.2.4-win64/upx.exe", os.path.join(os.getcwd(), "upx.exe"))
else:
os.system("python3 -m pip install pyyaml install-jdk tqdm psutil requests pygithub rtoml nuitka")
os.system("python3 -m pip install pyyaml install-jdk tqdm psutil requests imageio pygithub rtoml nuitka")

os.mkdir("dist")
for file in os.listdir(os.path.join(os.getcwd(), "src")):
Expand All @@ -25,9 +25,10 @@
args.append("--windows-icon-from-ico=favicon.png")
if platform.system() == 'MacOS':
args.append("--macos-app-icon=favicon.png")
subprocess.call(args)
subprocess.call(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if platform.system() == 'Windows':
subprocess.call(["upx.exe", os.path.join(os.getcwd(), "dist", file + ".exe"), "-o",
os.path.join(os.getcwd(), "dist", file + ".exe"), "-9", "-q"])
break
# 傻逼
# 狗屎代碼

0 comments on commit 43ad484

Please sign in to comment.