Хуй знает, че это за микро-правки, на ноуте старом нашел незакомиченную репу

This commit is contained in:
IgorTimofeev 2022-01-01 19:41:51 +07:00
parent 66fb55d6c2
commit 2326e70adc

16
OS.lua
View File

@ -7,10 +7,13 @@ local bootFilesystemProxy = component.proxy(component.proxy(component.list("eepr
-- Executes file from boot HDD during OS initialization (will be overriden in filesystem library later) -- Executes file from boot HDD during OS initialization (will be overriden in filesystem library later)
function dofile(path) function dofile(path)
local stream, reason = bootFilesystemProxy.open(path, "r") local stream, reason = bootFilesystemProxy.open(path, "r")
if stream then if stream then
local data, chunk = "" local data, chunk = ""
while true do while true do
chunk = bootFilesystemProxy.read(stream, math.huge) chunk = bootFilesystemProxy.read(stream, math.huge)
if chunk then if chunk then
data = data .. chunk data = data .. chunk
else else
@ -21,6 +24,7 @@ function dofile(path)
bootFilesystemProxy.close(stream) bootFilesystemProxy.close(stream)
local result, reason = load(data, "=" .. path) local result, reason = load(data, "=" .. path)
if result then if result then
return result() return result()
else else
@ -41,9 +45,7 @@ package = {
} }
-- Checks existense of specified path. It will be overriden after filesystem library initialization -- Checks existense of specified path. It will be overriden after filesystem library initialization
local function requireExists(path) local requireExists = bootFilesystemProxy.exists
return bootFilesystemProxy.exists(path)
end
-- Works the similar way as native Lua require() function -- Works the similar way as native Lua require() function
function require(module) function require(module)
@ -133,10 +135,8 @@ local filesystem = UIRequire("Filesystem")
-- Setting main filesystem proxy to what are we booting from -- Setting main filesystem proxy to what are we booting from
filesystem.setProxy(bootFilesystemProxy) filesystem.setProxy(bootFilesystemProxy)
-- Redeclaring requireExists function after filesystem library initialization -- Replacing requireExists function after filesystem library initialization
requireExists = function(variant) requireExists = filesystem.exists
return filesystem.exists(variant)
end
-- Loading other libraries -- Loading other libraries
UIRequire("Component") UIRequire("Component")
@ -202,6 +202,7 @@ event.addHandler(
else else
if not GPUProxy.getScreen() then if not GPUProxy.getScreen() then
local address = component.list("screen")() local address = component.list("screen")()
if address then if address then
bindScreen(address) bindScreen(address)
end end
@ -217,6 +218,7 @@ system.authorize()
-- Main loop with UI regeneration after errors -- Main loop with UI regeneration after errors
while true do while true do
local success, path, line, traceback = system.call(workspace.start, workspace, 0) local success, path, line, traceback = system.call(workspace.start, workspace, 0)
if success then if success then
break break
else else