37 lines
944 B
Lua
37 lines
944 B
Lua
local expect = require "cc.expect".expect
|
|
local base_url = "https://git.cadencoaster.com/Rivulet/ccde/raw/branch/main/"
|
|
local function download_to(path)
|
|
expect(2, path, "string")
|
|
term.write(path)
|
|
if not http.checkURL(base_url..path) then error("URL is not valid" ,2) end
|
|
local data = http.get(base_url..path).readAll()
|
|
fs.makeDir(fs.getDir(path))
|
|
local file = fs.open(path,"w")
|
|
if not file then error("Failed to open file", 2) end
|
|
file.write(data)
|
|
file.close()
|
|
print(" OK")
|
|
end
|
|
|
|
local filesystem = {
|
|
files = {
|
|
"startup/00_entrypointclient.lua",
|
|
"startup/99_phoneOS.lua",
|
|
"startup/01_repo.lua",
|
|
"libs/containers.lua",
|
|
"libs/windows.lua",
|
|
"apps/com.ruffles.launcher",
|
|
},
|
|
dirs = {
|
|
"global-libraries",
|
|
"apps-meta",
|
|
},
|
|
}
|
|
|
|
for _,i in ipairs(filesystem.dirs) do
|
|
print("making dir",i)
|
|
fs.makeDir(i)
|
|
end
|
|
for _,i in ipairs(filesystem.files) do
|
|
download_to(i)
|
|
end |