Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- WIP new installer for Epoch with dependency management and command aliasing
- local programURL = "https://raw.githubusercontent.com/Haeleon/Epoch/main/programs/"
- local programs = {
- installer={
- args=nil,
- libdeps=nil,
- },
- fast_excavate={
- args={"#width", "<#length>"},
- libdeps={"self"},
- },
- fill={
- args={"#x1", "#y1", "#z1", "#x2", "#y2", "#z2", "'blockname'", "<'replace|hollow|frame|corners'>"},
- libdeps=nil,
- },
- }
- local libraryURL = "https://raw.githubusercontent.com/Haeleon/Epoch/main/programs/"
- local libraries = {
- build={
- libdeps=nil,
- },
- self={
- libdeps=nil,
- }
- }
- shell.run("cd /")
- shell.run("delete epoch/")
- for k, v in pairs(libraries) do
- shell.run("wget "..libraryURL..k..".lua epoch/"..k..".lua")
- end
- for k, v in pairs(programs) do
- shell.run("wget "..programURL..k..".lua epoch/"..k..".lua")
- shell.setAlias(k, "epoch/"..k..".lua")
- if v.args then
- shell.setCompletionFunction(
- "epoch/"..k..".lua",
- function(_, i, c)
- local n = i
- if #c < 1 then
- return {
- table.concat(v.args, " ", n)
- }
- end
- if n < #v.args then
- return {" "}
- end
- end
- )
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement