refactor(config): use pathlib for missing config creation

Agent-Logs-Url: https://github.com/rommapp/romm/sessions/0c94e1c8-0f79-4f5f-a72b-e45832906d00

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-05-08 13:55:38 +00:00
committed by GitHub
parent 9ef217339f
commit eae577f74c

View File

@@ -195,8 +195,9 @@ class ConfigManager:
)
try:
os.makedirs(os.path.dirname(self.config_file), exist_ok=True)
Path(self.config_file).touch(exist_ok=True)
config_file = Path(self.config_file)
config_file.parent.mkdir(parents=True, exist_ok=True)
config_file.touch(exist_ok=True)
self._config_file_mounted = True
self._config_file_writable = os.access(self.config_file, os.W_OK)