fix: improve path handling for PyInstaller compatibility
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user