From 5976651a2661c827c2d26947fd1ab64341ffbef5 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 8 Apr 2025 20:06:25 +0200 Subject: [PATCH] feat: Create note parent directories if necessary --- topen.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/topen.py b/topen.py index 342f435..9de9da5 100755 --- a/topen.py +++ b/topen.py @@ -58,8 +58,11 @@ def main(): if not uuid: _ = sys.stderr.write(f"Could not find task for ID: {cfg.task_id}.") sys.exit(1) + fpath = get_notes_file(uuid, notes_dir=cfg.notes_dir, notes_ext=cfg.notes_ext) + if not fpath.parent.exists(): + fpath.parent.mkdir(parents=True, exist_ok=True) open_editor(fpath, editor=cfg.notes_editor) if fpath.exists():