wyvern/installer.lua

32 lines
849 B
Lua
Raw Normal View History

2018-07-26 09:48:51 +00:00
local wyvern_files = {
root = "https://osmarks.tk/git/osmarks/wyvern/raw/branch/master/",
2018-07-26 14:56:42 +00:00
files = { "installer.lua", "luadash.lua", "lib.lua", "backend-chests.lua" }
2018-07-26 09:48:51 +00:00
}
local args = {...}
2018-07-26 10:00:42 +00:00
local command = args[1]
2018-07-26 09:48:51 +00:00
local function download_group(g)
2018-07-26 10:00:42 +00:00
for _, file in pairs(g.files) do
2018-07-26 09:59:05 +00:00
local url = g.root .. file
local h = http.get(url)
local contents = h.readAll()
local f = fs.open(file, "w")
f.write(contents)
f.close()
print("Written", file, "from", url)
2018-07-26 10:00:42 +00:00
end
2018-07-26 09:48:51 +00:00
end
local function prompt(msg)
write(msg .. "> ")
return read()
end
local function install_wyvern() download_group(wyvern_files) end
if command == "update" then
install_wyvern()
elseif command == "install" then
install_wyvern()
shell.run "edit wyvern_config.tbl" -- open editor for config edits
end