webp_to_png_gui/build.py
2024-05-05 22:27:17 +08:00

17 lines
588 B
Python

import os
import subprocess
import shutil
import sys
script_dir = os.path.dirname(os.path.abspath(__file__))
source_dir = os.path.join(script_dir,"webp_to_png","data")
des_dir = os.path.join(source_dir,"dist","pyinstaller")
if sys.platform.startswith('win32'):
des_dir = os.path.join(des_dir,"win_amd64")
print("You are on the windows platform,it will put data into",des_dir)
else:
print("you are on the other platform please put webp_to_png/data \"data\" directory into the exe directory")
subprocess.run(["poetry","build"], check=True)
shutil.copytree(source_dir,des_dir)