mirror of
https://github.com/20kdc/OC-KittenOS.git
synced 2024-11-23 19:08:05 +11:00
quickly fix this (this is r5 now)
This commit is contained in:
parent
27f7fe35da
commit
13d3abfd26
@ -91,12 +91,11 @@ function opInstall(packageId, checked)
|
|||||||
for _, v in ipairs(gback) do
|
for _, v in ipairs(gback) do
|
||||||
local f = destProx.open(v .. ".C2T", "wb")
|
local f = destProx.open(v .. ".C2T", "wb")
|
||||||
assert(f, "unable to create download file")
|
assert(f, "unable to create download file")
|
||||||
xpcall(function ()
|
local ok, e = pcall(download, v, function (b)
|
||||||
destProx.close(f)
|
|
||||||
end, download, v, function (b)
|
|
||||||
assert(destProx.write(f, b or ""), "unable to save data")
|
assert(destProx.write(f, b or ""), "unable to save data")
|
||||||
end, downloadSrc)
|
end, downloadSrc)
|
||||||
destProx.close(f)
|
destProx.close(f)
|
||||||
|
if not ok then error(e) end
|
||||||
end
|
end
|
||||||
-- CRITICAL SECTION --
|
-- CRITICAL SECTION --
|
||||||
if destProx.exists("data/app-claw/" .. packageId .. ".c2x") then
|
if destProx.exists("data/app-claw/" .. packageId .. ".c2x") then
|
||||||
@ -141,15 +140,16 @@ function opRemove(packageId, checked)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function ender(...)
|
local ok, e
|
||||||
|
if downloadSrc then
|
||||||
|
ok, e = pcall(opInstall, packageId, checked)
|
||||||
|
else
|
||||||
|
ok, e = pcall(opRemove, packageId, checked)
|
||||||
|
end
|
||||||
destProx = nil
|
destProx = nil
|
||||||
downloadSrc = nil
|
downloadSrc = nil
|
||||||
primaryINet = nil
|
primaryINet = nil
|
||||||
neo.executeAsync("app-claw", packageId)
|
neo.executeAsync("app-claw", packageId)
|
||||||
return ...
|
if not ok then
|
||||||
end
|
error(e)
|
||||||
if downloadSrc then
|
|
||||||
xpcall(ender, opInstall, packageId, checked)
|
|
||||||
else
|
|
||||||
xpcall(ender, opRemove, packageId, checked)
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user