Added .env variable override through --config param

This commit is contained in:
FeedClogger
2026-01-20 17:02:29 -08:00
committed by Ahmed Allam
parent 4337991d05
commit 4ab9af6e47
2 changed files with 33 additions and 0 deletions
+8
View File
@@ -163,6 +163,14 @@ class Config:
return cls.save({"env": merged})
@classmethod
def override(cls, key: str, value: str) -> None:
"""Override a configuration variable dynamically."""
if hasattr(cls, key):
setattr(cls, key, value)
else:
os.environ[key] = value
def apply_saved_config() -> dict[str, str]:
return Config.apply_saved()