diff --git a/scripts/compile_to_exe.py b/scripts/compile_to_exe.py index 39f07b2..8b86ac8 100644 --- a/scripts/compile_to_exe.py +++ b/scripts/compile_to_exe.py @@ -3,7 +3,6 @@ import shutil import subprocess import sys -from typing import List BUILD_DIR = ".build" DIST_DIR = "dist" @@ -12,6 +11,7 @@ NOCONSOLE_FLAG = "--noconsole" EXE_EXT = ".exe" + def compile_exe(script_file: str, config: str) -> None: output_directory = os.path.join(BUILD_DIR, config) os.makedirs(output_directory, exist_ok=True) @@ -19,9 +19,7 @@ def compile_exe(script_file: str, config: str) -> None: # PyInstaller flags pyinstaller_flags = [ONEFILE_FLAG] - if config == "debug": - pyinstaller_flags.append("--debug") - else: + if config == "release": pyinstaller_flags.append(NOCONSOLE_FLAG) try: @@ -35,6 +33,7 @@ def compile_exe(script_file: str, config: str) -> None: exe_name = f"{script_name}{EXE_EXT}" shutil.move(os.path.join(DIST_DIR, exe_name), os.path.join(output_directory, exe_name)) + def main() -> None: parser = argparse.ArgumentParser(description="Compile and move executable based on configuration") parser.add_argument("script_file", help="Python script file to compile") @@ -44,5 +43,6 @@ def main() -> None: compile_exe(args.script_file, args.config) + if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/scripts/create_release.py b/scripts/create_release.py index 3d18e10..2a7ec69 100644 --- a/scripts/create_release.py +++ b/scripts/create_release.py @@ -12,7 +12,7 @@ COMPILE_SCRIPT = 'compile_to_exe.py' SERVER_UI_SCRIPT = 'start_server_ui.py' WINDOWS_COMPILED_SCRIPT = 'start_server_ui.exe' -CONFIG = 'release' +CONFIG = 'debug' SPEC_FILE = 'start_server_ui.spec'