From 76eeb5c32c5900e6bd219e60e22459c33f3f4d59 Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Sun, 9 Dec 2018 13:27:23 +0000 Subject: Default to using vim.tiny if /usr/bin/vim.tiny is not set. --- telem.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'telem.lua') diff --git a/telem.lua b/telem.lua index 151f062..a6fcf47 100755 --- a/telem.lua +++ b/telem.lua @@ -12,6 +12,10 @@ stringx = require("pl.stringx") table = require("table") _BBS_ROOT = "/var/bbs/" +_EDITOR = os.getenv("EDITOR") +if not _EDITOR then + _EDITOR = "/usr/bin/vim.tiny" +end -- Global var declarations @@ -273,7 +277,7 @@ function do_new() end -- Save body of post to temp file local filename = os.tmpname() - os.execute("$EDITOR " .. filename) + os.execute(_EDITOR .. " " .. filename) -- TODO: show and confirm -- Make thread dir local timestamp = tostring(os.time()) @@ -343,7 +347,7 @@ end function do_type_reply() local filename = os.tmpname() - os.execute("$EDITOR " .. filename) + os.execute(_EDITOR .. " " .. filename) local timestamp = tostring(os.time()) local newfilename = timestamp .. "-" .. username local newpath = path.join(current_thread.directory, newfilename) -- cgit v1.2.3