feat: Only annotate tasks if note file was created
In the case of opening the notes but then backing out again without actually writing a notes file we should also not annotate the task with anything, since it technically still does not have a note.
This commit is contained in:
parent
caec33120c
commit
9d5fa3e244
1 changed files with 4 additions and 3 deletions
5
topen.py
5
topen.py
|
|
@ -57,10 +57,11 @@ def main():
|
||||||
if not uuid:
|
if not uuid:
|
||||||
_ = sys.stderr.write(f"Could not find task for ID: {cfg.task_id}.")
|
_ = sys.stderr.write(f"Could not find task for ID: {cfg.task_id}.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
fname = get_notes_file(uuid, notes_dir=cfg.notes_dir, notes_ext=cfg.notes_ext)
|
fpath = get_notes_file(uuid, notes_dir=cfg.notes_dir, notes_ext=cfg.notes_ext)
|
||||||
|
|
||||||
open_editor(fname, editor=cfg.notes_editor)
|
open_editor(fpath, editor=cfg.notes_editor)
|
||||||
|
|
||||||
|
if fpath.exists():
|
||||||
add_annotation_if_missing(task, annotation_content=cfg.notes_annot)
|
add_annotation_if_missing(task, annotation_content=cfg.notes_annot)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue