aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolderpunk <solderpunk@sdf.org>2018-12-09 13:27:23 +0000
committerSolderpunk <solderpunk@sdf.org>2018-12-09 13:27:23 +0000
commit76eeb5c32c5900e6bd219e60e22459c33f3f4d59 (patch)
tree006b6cc45f5a13a22346aef83dfc38ea1b8b4dbe
parentUse chmod to make new files/dirs world readable/exable. (diff)
Default to using vim.tiny if /usr/bin/vim.tiny is not set.
-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)