pimterry / notes

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

Use fallback editor if $EDITOR undefined #3

Closed ecksun closed 7 years ago

ecksun commented 7 years ago

Apparently I did not have $EDITOR set, however debian based systems have the editor symlink. This caused issues for me when trying to create a new note:

$ ./notes new test
./notes: line 71: /home/user/notes/test.md: No such file or directory

This PR thus uses that binary in case $EDITOR is unset.

Edit: because of issue #2 I don't know how to add a test-case for this :(

pimterry commented 7 years ago

Awesome, thanks! Didn't know that about debian, great spot.

I've merged this and added tests, it'll be in the next release (0.1.2) which I'll be putting out later today.

I've also received #6 too, with a different solution (fail if no $EDITOR is set) - I'm just going to combine the two: use $EDITOR if possible, fall back to editor, or throw a nice error.

Thanks so much!