Skip to content

Commit

Permalink
[Normal] Update Some Code
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdWindScholar committed Feb 8, 2025
1 parent 3910f36 commit 7e5e71f
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,23 @@ def zip_folder(folder_path):
PyInstaller.__main__.run(['-F', 'run.py', '--exclude-module=numpy', '-i', 'icon.ico'])

if os.name == 'nt':
if os.path.exists(local + os.sep + "dist" + os.sep + "run.exe"):
shutil.move(local + os.sep + "dist" + os.sep + "run.exe", local)
if os.path.exists(local + os.sep + "bin" + os.sep + "Linux"):
shutil.rmtree(local + os.sep + "bin" + os.sep + "Linux")
if os.path.exists(local + os.sep + "bin" + os.sep + "Android"):
shutil.rmtree(local + os.sep + "bin" + os.sep + "Android")
if os.path.exists(local + os.sep + "bin" + os.sep + "Darwin"):
shutil.rmtree(local + os.sep + "bin" + os.sep + "Darwin")
if os.path.exists(local + "/dist/run.exe"):
shutil.move(local + "/dist/run.exe", local)
if os.path.exists(local + "/bin/Linux"):
shutil.rmtree(local + "/bin/Linux")
if os.path.exists(local + "/bin/Android"):
shutil.rmtree(local + "/bin/Android")
if os.path.exists(local + "/bin/Darwin"):
shutil.rmtree(local + "/bin/Darwin")
elif os.name == 'posix':
if os.path.exists(local + os.sep + "dist" + os.sep + "run"):
shutil.move(local + os.sep + "dist" + os.sep + "run", local)
if os.path.exists(local + os.sep + "bin" + os.sep + "Windows"):
shutil.rmtree(local + os.sep + "bin" + os.sep + "Windows")
for i in os.listdir(local + os.sep + "bin" + os.sep + "Linux"):
if os.path.exists(local + "/dist/run"):
shutil.move(local + "/dist/run", local)
if os.path.exists(local + "/bin/Windows"):
shutil.rmtree(local + "/bin/Windows")
for i in os.listdir(local + "/bin/Linux"):
if i == platform.machine():
continue
shutil.rmtree(local + os.sep + "bin" + os.sep + "Linux" + os.sep + i)
shutil.rmtree(local + "/bin/Linux/" + i)
for i in os.listdir(local):
if i not in ['run', 'run.exe', 'bin', 'LICENSE'] and not i.endswith(".py") and not i.endswith(".ico") and not i.endswith(".txt"):
print(f"Removing {i}")
Expand Down

0 comments on commit 7e5e71f

Please sign in to comment.