pimterry / notes

:pencil: Simple delightful note taking, with more unix and less lock-in.
https://github.com/pimterry/notes
MIT License
1.24k stars 82 forks source link

The strange case of missing note #53

Closed rmNULL closed 6 years ago

rmNULL commented 6 years ago

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

pimterry commented 6 years ago

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.

rmNULL commented 6 years ago

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

rmNULL commented 6 years ago

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