mirror of
https://github.com/usestrix/strix.git
synced 2026-08-23 03:12:37 +02:00
Added .env variable override through --config param
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user