From 37dd6481c45de41bda8b3845c45874886f6ff3d3 Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Thu, 13 Dec 2018 16:08:03 +0000 Subject: Delete tmp files which are no longer needed. --- telem.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'telem.lua') diff --git a/telem.lua b/telem.lua index 9675136..710bd20 100755 --- a/telem.lua +++ b/telem.lua @@ -298,7 +298,10 @@ function create_post() os.execute(_EDITOR .. " " .. filename) -- Check that file exists and is not empty if not path.exists(filename) then return nil end - if lfs.attributes(filename).size == 0 then return nil end + if lfs.attributes(filename).size == 0 then + file.delete(filename) + return nil + end -- Get confirmation from user print("PREVIEW:") print(string.rep("-",79)) @@ -314,6 +317,7 @@ function create_post() if c == "e" then goto edit elseif c == "n" then + file.delete(filename) return nil else return filename -- cgit v1.2.3