2023-10-13 13:44:20 +03:00
|
|
|
local repository = "https://git.salushnes.solutions/vftdan/cc-stuff/raw/branch/vftdan/augment/files.json"
|
2023-10-12 18:14:13 +03:00
|
|
|
local files = textutils.unserializeJSON(http.get(repository).readAll())
|
|
|
|
|
|
|
|
local function getFile(url, path)
|
|
|
|
local r, err = http.get(url)
|
|
|
|
io.write("GET " .. path .. " ... ")
|
|
|
|
if not r then
|
|
|
|
print("FAIL: " .. err)
|
|
|
|
return false, err
|
|
|
|
end
|
|
|
|
io.open(path, "w"):write(r.readAll()):close()
|
|
|
|
io.write("OK\n")
|
|
|
|
end
|
|
|
|
|
|
|
|
for i, file in ipairs(files.files) do
|
2023-10-12 20:42:25 +03:00
|
|
|
if type(file) == "string" then
|
|
|
|
getFile(files.repository .. "/" .. file, file)
|
|
|
|
else
|
|
|
|
getFile(files.repository .. "/" .. file.src, file.path)
|
|
|
|
end
|
2023-10-12 18:14:13 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
shell.run("main.lua")
|