fix: Add edge case tests and improve write permissions error
This commit is contained in:
parent
a2c5cf281b
commit
0820b686e5
2 changed files with 70 additions and 1 deletions
7
topen.py
7
topen.py
|
|
@ -63,7 +63,12 @@ def main(cfg: "TConf | None" = None, io: "_IO | None" = None) -> int:
|
|||
|
||||
fpath = get_notes_file(uuid, notes_dir=cfg.notes_dir, notes_ext=cfg.notes_ext)
|
||||
|
||||
_ensure_parent_dir(fpath)
|
||||
try:
|
||||
_ensure_parent_dir(fpath)
|
||||
except PermissionError:
|
||||
io.err(f"Could not write required directories for path: {fpath}.\n")
|
||||
return 1
|
||||
|
||||
io.out(f"Editing note: {fpath}")
|
||||
open_editor(fpath, editor=cfg.notes_editor, io=io)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue