summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenny Shields <mail@kennyshields.net>2016-07-16 16:58:44 -0400
committerKenny Shields <mail@kennyshields.net>2016-07-16 16:58:44 -0400
commitfbb8533004b7444c0b3a18693b0f4d83bb4c235c (patch)
treee97fc1d755edfc48b6cc39307fcb73414fe0c331
parentcbabf2216846f74718cce84c095b00ed6e1e4870 (diff)
downloadstp-fbb8533004b7444c0b3a18693b0f4d83bb4c235c.tar.gz
stp-fbb8533004b7444c0b3a18693b0f4d83bb4c235c.zip
Remove global variable in temp file code
-rw-r--r--init.lua4
1 files changed, 1 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index b2eb28e..1c02a0b 100644
--- a/init.lua
+++ b/init.lua
@@ -183,9 +183,7 @@ function lib.init(config)
elseif config.text then
temp = true
path = os.tmpname()
- file = io.open(path, "w")
- file:write(config.text)
- file:close()
+ io.open(path, "w"):write(config.text):close()
else
return false
end