pimterry/notes

Bug: Typing "notes new" without a name should error out

primis opened this issue · 5 comments

if you type "notes new" without a file name, you create a note just named ".md"
We should include a sanity check in the code to prevent this from happening.

Another option that I thought of would be assigning a note name automatically (IE, a date string). I'd be willing to implement this if given a green light

Good point. Yes, the current behaviour is definitely bad, happy to fix it.

Creating a new note as something like "quicknote-2016-12-11.md" or similar sounds good to me. I'm not that attached to 'quicknote' specifically - any nice friendly name that makes it clear this is just a note that was quickly jotted down would be fine.

I think I'd rather not include the exact time (since it'll get awkwardly long), but we do need to handle the case where the generated filename already exists somehow. Quicknote, Quicknote2?

I say we use a configgable datestring, which is run through date, and the default case of "quicknote-YYYY-MM-DD.md" would be fine.
Also, we could append a number. IE:
quicknote-2016-12-11.1.md

Sure, sounds good. You're right, appending instead makes sorting work much better.

Pull Request #32 should resolve this.