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
7
topen.py
7
topen.py
|
|
@ -57,11 +57,12 @@ def main():
|
|||
if not uuid:
|
||||
_ = sys.stderr.write(f"Could not find task for ID: {cfg.task_id}.")
|
||||
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)
|
||||
|
||||
add_annotation_if_missing(task, annotation_content=cfg.notes_annot)
|
||||
if fpath.exists():
|
||||
add_annotation_if_missing(task, annotation_content=cfg.notes_annot)
|
||||
|
||||
|
||||
def get_task(id: str | int, data_location: Path) -> Task:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue