local args = { ... } local target_branch = "main" local program_name = args[1] if program_name == nil then print("Usage: lupdate ") return end response = http.get("https://gitea.layla.gg/layla/computercraft/raw/branch/" .. target_branch .. "/" .. program_name .. ".lua", nil) io.write("Updating " .. program_name .. ".lua\n") if response.getResponseCode() == 200 then file = fs.open(program_name .. ".lua", "w") file.write(response.readAll()) file.close() fs.move(program_name .. ".lua", "/rom/programs/" .. program_name .. ".lua") print("Updated " .. program_name .. ".lua") else print("Failed to update " .. program_name .. ".lua") print(response) end