Initial upload: DevDash CLI with TUI dashboard
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-02-01 06:52:49 +00:00
parent aa57b6222e
commit a44a057cae

View File

@@ -0,0 +1,26 @@
import json
import os
from pathlib import Path
from src.config.settings import Settings
class ConfigManager:
def __init__(self, config_path: str = None):
if config_path is None:
config_path = os.environ.get(
"DEVDASH_CONFIG",
str(Path.home() / ".devdash" / "config.json")
)
self.config_path = Path(config_path)
def load_config(self) -> Settings:
if self.config_path.exists():
with open(self.config_path) as f:
data = json.load(f)
return Settings(**data)
return Settings()
def save_config(self, settings: Settings) -> None:
self.config_path.parent.mkdir(parents=True, exist_ok=True)
with open(self.config_path, "w") as f:
json.dump(settings.model_dump(), f, indent=2)