Operating system for OpenComputers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
535B

  1. print(pcall(function()
  2. local shenv = {}
  3. function shenv.quit()
  4. os.setenv("run",nil)
  5. end
  6. 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})
  7. print(_VERSION)
  8. os.setenv("run",true)
  9. while os.getenv("run") do
  10. io.write((os.getenv("PWD") or _VERSION).."> ")
  11. tResult = {pcall(load(io.read(),"shell","t",shenv))}
  12. if tResult[1] == true then table.remove(tResult,1) end
  13. for k,v in pairs(tResult) do
  14. print(v)
  15. end
  16. end
  17. end))