iteration
This commit is contained in:
parent
745de810e4
commit
b52af66471
18
lib/lum.lua
18
lib/lum.lua
@ -3,8 +3,24 @@ local bin_path = "/bin/"
|
||||
local lib_path = "/lib/"
|
||||
local startup_path = "/startup/"
|
||||
|
||||
settings.define("lum.target_branch", {
|
||||
description = "Target branch for updates",
|
||||
type = "string",
|
||||
default = "main"
|
||||
})
|
||||
|
||||
settings.define("lum.log_level", {
|
||||
description = "Log Level",
|
||||
type = "string",
|
||||
default = "debug"
|
||||
})
|
||||
|
||||
function download_lua(remote_path, local_path)
|
||||
response = http.get("https://gitea.layla.gg/layla/computercraft/raw/branch/" .. target_branch .. "/" .. remote_path .. ".lua", nil)
|
||||
local url = "https://gitea.layla.gg/layla/computercraft/raw/branch/" .. settings.get("lum.target_branch") .. "/" .. remote_path .. ".lua"
|
||||
if settings.get("lum.log_level") == "debug" then
|
||||
io.write("Downloading " .. url .. " to " .. local_path .. "\n")
|
||||
end
|
||||
local response = http.get(url, nil)
|
||||
if response.getResponseCode() == 200 then
|
||||
file = fs.open(local_path, "w")
|
||||
file.write(response.readAll())
|
||||
|
Loading…
Reference in New Issue
Block a user