dirs: opportuniscally create directories
All checks were successful
checks-impure / test (pull_request) Successful in 1m39s
checks / test (pull_request) Successful in 2m35s

This commit is contained in:
Jörg Thalheim 2023-11-10 12:53:38 +01:00
parent 657cdd6e67
commit c0be813a4c

View File

@ -44,17 +44,13 @@ def user_config_dir() -> Path:
def clan_config_dir() -> Path:
path = user_config_dir() / "clan"
if not path.exists():
log.debug(f"Creating path with parents {path}")
path.mkdir(parents=True)
path.mkdir(parents=True, exist_ok=True)
return path.resolve()
def clan_flakes_dir() -> Path:
path = clan_config_dir() / "flakes"
if not path.exists():
log.debug(f"Creating path with parents {path}")
path.mkdir(parents=True)
path.mkdir(parents=True, exist_ok=True)
return path.resolve()