mirror of
https://github.com/rommapp/romm.git
synced 2026-06-28 06:46:00 +00:00
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:
committed by
GitHub
parent
9ef217339f
commit
eae577f74c
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user