LukeSmithxyz / lb

Blog & RSS system in less than 100 lines of shell script
GNU General Public License v3.0
280 stars 81 forks source link

Added check just in case $EDITOR environment variable is not set #5

Closed ghost closed 6 years ago

ghost commented 6 years ago

Non-Linux based Unix systems don't always have the $EDITOR environment variable set. All Unix systems will have vi installed out of the box since it's a part of POSIX standards.

I encountered this issue when running the script on OpenBSD, since OpenBSD doesn't set $EDITOR out of the box.

Another way to handle this would be to throw an exception at script execution stating that you need $EDITOR set.

EDIT: I should clarify I know it says that $EDITOR needs to be set in the README, I just found it interesting that there was nothing notifying the user of this at runtime.