2018-11-03 03:05:41 +11:00
|
|
|
local shenv = {}
|
|
|
|
setmetatable(shenv,{__index=function(_,k) if _G[k] then return _G[k] elseif fs.exists("/boot/exec/"..k..".lua") then return loadfile("/boot/exec/"..k..".lua") end end})
|
2019-01-08 18:03:51 +11:00
|
|
|
print(_VERSION)
|
2018-11-03 03:05:41 +11:00
|
|
|
while true do
|
2019-01-08 18:03:51 +11:00
|
|
|
io.write((os.getenv("PWD") or _VERSION).."> ")
|
2018-11-03 03:05:41 +11:00
|
|
|
tResult = {pcall(load(io.read(),"shell","t",shenv))}
|
2019-01-08 18:03:51 +11:00
|
|
|
if tResult[1] == true then table.remove(tResult,1) end
|
2018-11-03 03:05:41 +11:00
|
|
|
for k,v in pairs(tResult) do
|
|
|
|
print(v)
|
|
|
|
end
|
|
|
|
end
|