Skip to content

Commit

Permalink
fix: executable now looks for config.ini in the same folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Holf committed Sep 30, 2024
1 parent d9fb79e commit 8e1862f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion weduc_timetable_extractor/config_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ def get_config():
global config

if config == None:
project_root = Path(__file__).resolve().parent.parent
if getattr(sys, "frozen", False):
# We are running in a bundle (PyInstaller)
project_root = Path(sys.executable).resolve().parent
else:
# We are running in a normal Python environment
project_root = Path(__file__).resolve().parent.parent

config_file_path = project_root / "config.ini"

config = configparser.ConfigParser()
Expand Down

0 comments on commit 8e1862f

Please sign in to comment.