Skip to content

Commit

Permalink
debug -> release
Browse files Browse the repository at this point in the history
  • Loading branch information
geugenm committed Dec 13, 2023
1 parent 6eeb2ac commit 2e7afdb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions scripts/compile_to_exe.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import shutil
import subprocess
import sys
from typing import List

BUILD_DIR = ".build"
DIST_DIR = "dist"
Expand All @@ -12,16 +11,15 @@
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)

# PyInstaller flags
pyinstaller_flags = [ONEFILE_FLAG]

if config == "debug":
pyinstaller_flags.append("--debug")
else:
if config == "release":
pyinstaller_flags.append(NOCONSOLE_FLAG)

try:
Expand All @@ -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")
Expand All @@ -44,5 +43,6 @@ def main() -> None:

compile_exe(args.script_file, args.config)


if __name__ == "__main__":
main()
main()
2 changes: 1 addition & 1 deletion scripts/create_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'


Expand Down

0 comments on commit 2e7afdb

Please sign in to comment.