mirror of
https://github.com/aclist/dztui.git
synced 2026-11-01 15:42:51 +01:00
fix: make parents if missing (#312)
This commit is contained in:
1 parent
ac9f582def
commit
162839672b
1 file changed
+1
@@ -14,6 +14,7 @@ def read_json(path: Path) -> Any:
|
|||||||
|
|
||||||
def write_json(data: dict[str, Any], path: Path) -> None:
|
def write_json(data: dict[str, Any], path: Path) -> None:
|
||||||
try:
|
try:
|
||||||
|
path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
j = json.dumps(data, indent=2)
|
j = json.dumps(data, indent=2)
|
||||||
path.write_text(j)
|
path.write_text(j)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in new issue
Block a user