Skip to content

Commit

Permalink
fix somthing
Browse files Browse the repository at this point in the history
  • Loading branch information
lilingfengdev committed Jun 29, 2024
1 parent d0d81d9 commit 15c45ee
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,11 @@
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"))


os.system("python3 -m pip install pyyaml install-jdk tqdm psutil requests imageio pygithub rtoml nuitka")

os.mkdir("build")
os.mkdir("dist")


def build(file):
filepath = os.path.join(os.getcwd(), "src", file)
print(f"build {file}", flush=True)
def build(filepath):
args = ["python", "-m", "nuitka", "--onefile", filepath, "--assume-yes-for-downloads", "--output-dir=build"]
if platform.system() == 'Windows':
args.append("--windows-icon-from-ico=favicon.png")
Expand All @@ -35,7 +30,7 @@ def build(file):
args.append("--windows-console-mode=disable")
args.append("--enable-plugin=pyside6")
subprocess.call(args)
filename = os.path.splitext(file)[0]
filename = os.path.splitext(os.path.basename(filepath))[0]
for f in os.listdir(os.path.join(os.getcwd(), "build")):
if f.startswith(filename) and not os.path.isdir(os.path.join(os.getcwd(), "build", f)):
shutil.move(os.path.join(os.getcwd(), "build", f), os.path.join(os.getcwd(), "dist", f))
Expand Down

0 comments on commit 15c45ee

Please sign in to comment.