TLCO fix & boot file extension change (#37)

This commit fixes the TLCO boot option (which hasn't been working for a
while now), and also changes boot file extensions from .boot to .lua.
This commit was merged in pull request #37.
This commit is contained in:
Kan18
2020-07-24 20:41:21 -04:00
committed by GitHub
parent b45cd45bcb
commit 816ea366ab
5 changed files with 48 additions and 18 deletions

View File

@@ -1,15 +0,0 @@
local pullEvent = os.pullEventRaw
local shutdown = os.shutdown
os.pullEventRaw = function()
error('')
end
os.shutdown = function()
os.pullEventRaw = pullEvent
os.shutdown = shutdown
os.run(getfenv(1), 'sys/boot/opus.boot')
end
os.queueEvent('modem_message')

30
sys/boot/tlco.lua Normal file
View File

@@ -0,0 +1,30 @@
local run = os.run
local shutdown = os.shutdown
local args = {...} -- keep the args so that they can be passed to opus.lua
os.run = function()
os.run = run
end
os.shutdown = function()
os.shutdown = shutdown
_ENV.multishell = nil -- prevent sys/apps/shell.lua erroring for odd reasons
local success, err = pcall(function()
run(_ENV, 'sys/boot/opus.lua', table.unpack(args))
end)
term.redirect(term.native())
if success then
print("Opus OS abruptly stopped.")
else
printError("Opus OS errored.")
printError(err)
end
print("Press any key to continue.")
os.pullEvent("key")
shutdown()
end
shell.exit()