fix: Correct dotenv loading to use dynamic directory based on execution context

This commit is contained in:
William Valentin
2025-07-29 16:38:21 -07:00
parent 4c04bfb92e
commit 13b2c9c416

View File

@@ -1,8 +1,12 @@
import os
import sys
from dotenv import load_dotenv
load_dotenv(override=True)
extDataDir = os.getcwd()
if getattr(sys, "frozen", False):
extDataDir = sys._MEIPASS
load_dotenv(dotenv_path=os.path.join(extDataDir, ".env"))
LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO").upper()
LOG_PATH = os.getenv("LOG_PATH", "/tmp/logs/thechart")