diff --git a/.github/workflows/buildexe.yml b/.github/workflows/buildexe.yml index ac7888a..32c49c8 100644 --- a/.github/workflows/buildexe.yml +++ b/.github/workflows/buildexe.yml @@ -26,8 +26,8 @@ jobs: env: UV_SYSTEM_PYTHON: 1 - - name: Build with Pyinstaller - run: pyinstaller -F src/main.py --add-data src/resources/:./resources/ --name AdventureSoft-Cave-of-Shadows + - name: Build with PyInstaller + run: pyinstaller -F src/main.py --hidden-import sys --add-data src/resources/:./resources/ --name AdventureSoft-Cave-of-Shadows - name: Publish uses: softprops/action-gh-release@v2.1.0 diff --git a/src/main.py b/src/main.py index d3be325..a0cac30 100644 --- a/src/main.py +++ b/src/main.py @@ -1,10 +1,9 @@ import json, pathlib, shlex -from sys import exit # This is needed for PyInstaller from io import TextIOWrapper from typing import TypedDict from datetime import datetime from inputs import get_valid_input, get_valid_arr_input -from colorama import Fore, Style +from colorama import Fore, Style, init RESOURCE_PATH = pathlib.Path(__file__).parent.resolve() GAME_WORLD = { @@ -295,6 +294,7 @@ def _save_game(self, override: list[PlayerDataType] | None = None): json.dump(all_player_datas, f) if __name__ == "__main__": + init() with open(f"{RESOURCE_PATH}/resources/AdventureSoft_logo.txt", "r") as f: print(f"{Fore.CYAN}Welcome to...\n{Style.BRIGHT}{f.read()}{Style.RESET_ALL}")