22 lines
620 B
Lua
22 lines
620 B
Lua
-- x-run: scp ./* pneumatic-pump:htdocs/cc/augment/
|
|
|
|
local repository = "https://git.salushnes.solutions/hkc/cc-stuff/raw/branch/master/augment/files.json"
|
|
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
|
|
getFile(files.repository .. "/" .. file.src, file.path)
|
|
end
|
|
|
|
shell.run("main.lua")
|