aboutsummaryrefslogtreecommitdiff
path: root/telem.lua
diff options
context:
space:
mode:
Diffstat (limited to 'telem.lua')
-rwxr-xr-xtelem.lua8
1 files changed, 6 insertions, 2 deletions
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)