Compare commits
3 Commits
5a9fa01cd7
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a2494b11b0 | |||
| 10a2cd4880 | |||
| 95734536f9 |
Binary file not shown.
BIN
apps/org.ruffles.launcher
Normal file
BIN
apps/org.ruffles.launcher
Normal file
Binary file not shown.
10
install.lua
10
install.lua
@@ -1,5 +1,5 @@
|
|||||||
local expect = require "cc.expect".expect
|
local expect = require "cc.expect".expect
|
||||||
local base_url = "https://git.cadencoaster.com/Rivulet/ccde/raw/branch/main/"
|
local base_url = "https://git.cadencoaster.com/Rivulet/ccphone/raw/branch/main/"
|
||||||
local function download_to(path)
|
local function download_to(path)
|
||||||
expect(2, path, "string")
|
expect(2, path, "string")
|
||||||
term.write(path)
|
term.write(path)
|
||||||
@@ -26,12 +26,12 @@ local filesystem = {
|
|||||||
"global-libraries",
|
"global-libraries",
|
||||||
"apps-meta",
|
"apps-meta",
|
||||||
},
|
},
|
||||||
}
|
}for _,i in ipairs(filesystem.dirs) do
|
||||||
|
|
||||||
for _,i in ipairs(filesystem.dirs) do
|
|
||||||
print("making dir",i)
|
print("making dir",i)
|
||||||
fs.makeDir(i)
|
fs.makeDir(i)
|
||||||
end
|
end
|
||||||
for _,i in ipairs(filesystem.files) do
|
for _,i in ipairs(filesystem.files) do
|
||||||
download_to(i)
|
download_to(i)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
shell.run("wget run https://raw.githubusercontent.com/Pyroxenium/Basalt2/main/install.lua -f /global-libraries/basalt.lua")
|
||||||
File diff suppressed because one or more lines are too long
3605
libs/deflate.lua
Normal file
3605
libs/deflate.lua
Normal file
File diff suppressed because it is too large
Load Diff
22
libs/persistent-storage.lua
Normal file
22
libs/persistent-storage.lua
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
local id = ...
|
||||||
|
local deflate = dofile("libs/deflate.lua")
|
||||||
|
local filepath = fs.combine("/persisted-data",id)
|
||||||
|
local expect = dofile("rom/modules/main/cc/expect.lua")
|
||||||
|
local expect, field = expect.expect, expect.field
|
||||||
|
local lib={}
|
||||||
|
function lib.load()
|
||||||
|
if fs.exists(filepath) then
|
||||||
|
local file = fs.open(filepath,"r")
|
||||||
|
local data = textutils.unserialise(deflate:DecompressDeflate(file.readAll()))
|
||||||
|
file.close()
|
||||||
|
return data
|
||||||
|
else
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
function lib.save(data)
|
||||||
|
expect(1,data,"table")
|
||||||
|
local file = fs.open(filepath,"w")
|
||||||
|
file.write(deflate:CompressDeflate(textutils.serialise(data),{level=8}))
|
||||||
|
end
|
||||||
|
return lib
|
||||||
30
scan.lua
30
scan.lua
@@ -51,8 +51,32 @@ local function format(scandata)
|
|||||||
return format_data
|
return format_data
|
||||||
end
|
end
|
||||||
local textdata = textutils.serialise(format(scan("/")))
|
local textdata = textutils.serialise(format(scan("/")))
|
||||||
local firstpart = ""
|
local firstpart = [[local expect = require "cc.expect".expect
|
||||||
local secondpart = ""
|
local base_url = "https://git.cadencoaster.com/Rivulet/ccphone/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 = ]]
|
||||||
|
local secondpart = [[
|
||||||
|
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
|
||||||
|
|
||||||
|
shell.run("wget run https://raw.githubusercontent.com/Pyroxenium/Basalt2/main/install.lua -f /global-libraries/basalt.lua")]]
|
||||||
local outfile = fs.open("install.lua","w")
|
local outfile = fs.open("install.lua","w")
|
||||||
outfile.write()
|
outfile.write(firstpart..textdata..secondpart)
|
||||||
outfile.close()
|
outfile.close()
|
||||||
Reference in New Issue
Block a user