aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolderpunk <solderpunk@sdf.org>2018-12-13 16:08:03 +0000
committerSolderpunk <solderpunk@sdf.org>2018-12-13 16:08:03 +0000
commit37dd6481c45de41bda8b3845c45874886f6ff3d3 (patch)
tree7093972d0a8b8e9294bc3385e2a86a15ce4aed1b
parentSmall bug from bad merge job. (diff)
Delete tmp files which are no longer needed.
-rwxr-xr-xtelem.lua6
1 files changed, 5 insertions, 1 deletions
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