pimterry/notes

The strange case of missing note

rmNULL opened this issue · 3 comments

Issue Summary

Newly created note(with extension) fails to open.

Steps to Reproduce

  1. notes new dylan.md
  2. type in text, save and quit
  3. notes o dylan.md
    3rd step opens a new note instead of the note created in step 1.
    Is this the expected behaviour? seems strange to me :\

Technical details:

In order to reassure my doubts the command below was run.
curl https://raw.githubusercontent.com/pimterry/notes/latest-release/notes > ~/bin/notes

You're right, this is odd behaviour, but it's not actually a missing note.

The problem is that new doesn't expect any file extension, so notes new dylan.md is actually creating a dylan.md.md file (i.e. it gets a double extension).

notes open meanwhile works with or without extension, so notes open opens dylan.md, which didn't exist before this point.

You should be able to open your note with notes open dylan.md.md. In the short-term, you can avoid this by not including a file extension in your new commands, but we should definitely fix this properly. I'm not sure if I'll have a lot of time this week, but I'd gladly accept PRs if you want to take a shot at it in the meantime.

Yes I did observe that, with notes ls. sorry for the clickbaity title

I made a quick patch, I'll send it across?