diff options
author | Solderpunk <solderpunk@sdf.org> | 2018-12-09 13:27:23 +0000 |
---|---|---|
committer | Solderpunk <solderpunk@sdf.org> | 2018-12-09 13:27:23 +0000 |
commit | 76eeb5c32c5900e6bd219e60e22459c33f3f4d59 (patch) | |
tree | 006b6cc45f5a13a22346aef83dfc38ea1b8b4dbe /telem.lua | |
parent | Use chmod to make new files/dirs world readable/exable. (diff) |
Default to using vim.tiny if /usr/bin/vim.tiny is not set.
Diffstat (limited to 'telem.lua')
-rwxr-xr-x | telem.lua | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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) |