summaryrefslogtreecommitdiff
path: root/pm.lua
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2022-06-27 23:54:48 +0100
committerubq323 <ubq323@ubq323.website>2022-06-27 23:54:48 +0100
commit3f6068ab48f00b6176b73315ebbe08027dc6f1f2 (patch)
treee3914386549f1fd96495d777301a9273b0d3c8f3 /pm.lua
parentfc6b1a255c1f962816e7a2b942b9275c9c197bb8 (diff)
hole
Diffstat (limited to 'pm.lua')
-rw-r--r--pm.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/pm.lua b/pm.lua
index 5fed3d0..d1323b1 100644
--- a/pm.lua
+++ b/pm.lua
@@ -1,7 +1,11 @@
local function dl(filename)
- local file=fs.open("/"..filename..".lua","w")
- local res = http.get("https://g.gh0.pw/ccprogs/plain/"..filename..".lua")
+ local file,err=fs.open("/"..filename..".lua","w")
+ if err then error("fs.open",err) end
+ local res,err = http.get("https://g.gh0.pw/ccprogs/plain/"..filename..".lua")
+ if err then error("http.get",err) end
file.write(res.readAll())
+ file.flush()
+ file.close()
end
dl(arg[1])