iteration

This commit is contained in:
2023-10-07 22:57:23 -04:00
commit c2cef57703
4 changed files with 129 additions and 0 deletions

19
lupdate.lua Normal file
View File

@@ -0,0 +1,19 @@
local args = { ... }
local program_name = args[1]
if program_name == nil then
print("Usage: lupdate <program_name>")
return
end
http.get("https://raw.githubusercontent.com/justync7/cc-programs/master/" .. program_name .. ".lua", nil, function(response)
if response.getResponseCode() == 200 then
local file = fs.open(program_name .. ".lua", "w")
file.write(response.readAll())
file.close()
print("Updated " .. program_name .. ".lua")
else
print("Failed to update " .. program_name .. ".lua")
end
end