bug fixing

This commit is contained in:
2026-01-26 13:09:32 +01:00
parent f8684077a2
commit 29a7f12abe
7 changed files with 597 additions and 17 deletions

View File

@@ -98,6 +98,18 @@ class Config:
"""Load configuration from YAML file and environment variables"""
self.config_path = Path(config_path)
# If config.yaml doesn't exist, try config.yaml.example
if not self.config_path.exists():
example_path = Path(str(config_path) + ".example")
if example_path.exists():
raise FileNotFoundError(
f"Config file '{config_path}' not found. "
f"Copy '{example_path}' to '{config_path}' and edit it with your settings.\n"
f"Run: cp {example_path} {config_path}"
)
else:
raise FileNotFoundError(f"Config file '{config_path}' not found")
# Load YAML configuration
with open(self.config_path) as f:
self._config: dict[str, Any] = yaml.safe_load(f)