diff options
-rwxr-xr-x | telem.lua | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 |