diff --git a/gitea_auth.py b/gitea_auth.py index 167357b..a02d92a 100644 --- a/gitea_auth.py +++ b/gitea_auth.py @@ -20,14 +20,15 @@ from dotenv import dotenv_values, load_dotenv import gitea_config +PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) + # Load standard .env if present -load_dotenv() +load_dotenv(os.path.join(PROJECT_ROOT, ".env")) # Dictionary to store configurations parsed dynamically from .env.* files DYNAMIC_CONFIGS = {} # Scan all files starting with .env in the project root to load multiple configurations -PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) for env_path in glob.glob(os.path.join(PROJECT_ROOT, ".env*")): # Skip directories and the example template if os.path.basename(env_path) == ".env.example":