diff options
Diffstat (limited to 'pm.lua')
-rw-r--r-- | pm.lua | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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]) |