Skip to content

Commit

Permalink
Fix where the saved_game.json file is when bundled
Browse files Browse the repository at this point in the history
  • Loading branch information
YummyBacon5 committed Dec 3, 2024
1 parent bbceda8 commit b943219
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
from colorama import Fore, Style, init, deinit

RESOURCE_PATH = pathlib.Path(__file__).parent.resolve()
SAVE_FILE_PATH = (pathlib.Path(sys._MEIPASS) if getattr(sys, "frozen", False) else RESOURCE_PATH) / "saved_game.json"

if getattr(sys, "frozen", False):
SAVE_FILE_PATH = RESOURCE_PATH / "saved_game.json"
else:
SAVE_FILE_PATH = pathlib.Path(sys.executable).parent / "saved_game.json"

GAME_WORLD = {
"Cave Entrance": {
Expand Down

0 comments on commit b943219

Please sign in to comment.