1
0
mirror of https://github.com/Adorable-Catgirl/Zorya-NEO.git synced 2024-11-23 10:48:06 +11:00
This commit is contained in:
Jane Roxanne 2020-03-22 00:38:31 -05:00
parent f5d18e6dbe
commit 0e52343432

View File

@ -4,9 +4,10 @@ local fs = require("filesystem")
local comp = require("component") local comp = require("component")
local function dl(url) local function dl(url)
local dat = "" local dat = ""
for chunk in internet.request(url) do for chunk in inet.request(url) do
dat = dat .. chunk dat = dat .. chunk
end end
return dat
end end
local function writefile(p2, dat) local function writefile(p2, dat)
@ -108,12 +109,14 @@ print("Downloading zorya-neo-update.tsar...")
for i=1, #rdat.assets do for i=1, #rdat.assets do
if (rdat.assets[i].name == "zorya-neo-update.tsar") then if (rdat.assets[i].name == "zorya-neo-update.tsar") then
arc = dl(rdat.assets[i].browser_download_url) arc = dl(rdat.assets[i].browser_download_url)
goto arc_downloaded goto arcdl
end end
end end
io.stderr:write("ERROR: zorya-neo-update.tsar not found!\n") io.stderr:write("ERROR: zorya-neo-update.tsar not found!\n")
return os.exit(1)
::arc_downloaded::
::arcdl::
local update = tsar.read(_r, _s, function() end) local update = tsar.read(_r, _s, function() end)
for ent in fs.list("/etc/zorya-neo/mods") do for ent in fs.list("/etc/zorya-neo/mods") do
if (update:exists("mods/"..ent)) then if (update:exists("mods/"..ent)) then