iteration

This commit is contained in:
Layla 2023-10-08 04:07:33 -04:00
parent 8eeaad61d5
commit 745de810e4

View File

@ -4,14 +4,13 @@ local lib_path = "/lib/"
local startup_path = "/startup/" local startup_path = "/startup/"
function download_lua(remote_path, local_path) function download_lua(remote_path, local_path)
response = http.get("https://gitea.layla.gg/layla/computercraft/raw/branch/" .. target_branch .. "/" .. program_name .. ".lua", nil) response = http.get("https://gitea.layla.gg/layla/computercraft/raw/branch/" .. target_branch .. "/" .. remote_path .. ".lua", nil)
if response.getResponseCode() == 200 then if response.getResponseCode() == 200 then
file = fs.open(local_path, "w") file = fs.open(local_path, "w")
file.write(response.readAll()) file.write(response.readAll())
file.close() file.close()
end
else else
io.write("Failed to update " .. program_name .. ".lua\n") io.write("Failed to download " .. remote_path .. ".lua\n")
io.write(response) io.write(response)
end end
end end