fix: improve path handling for PyInstaller compatibility

This commit is contained in:
2026-03-06 19:31:50 +01:00
parent 1b6c7dcc01
commit 16abf010ab
2 changed files with 18 additions and 5 deletions

View File

@@ -1,7 +1,15 @@
import json
import os
import sys
CONFIG_FILE = "config.json"
def get_app_dir():
if getattr(sys, 'frozen', False):
return os.path.dirname(sys.executable)
else:
# If in git_monitor package, go up to the project root
return os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
CONFIG_FILE = os.path.join(get_app_dir(), "config.json")
class Config:
def __init__(self):