Advertisement
joebodo

webopus.lua

Oct 31st, 2019
478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.84 KB | None | 0 0
  1. local BASE = 'https://raw.githubusercontent.com/kepler155c/opus/develop-1.8/sys/'
  2. local loaded = { }
  3.  
  4. local fs   = _G.fs
  5. local http = _G.http
  6.  
  7. local function run(fname, ...)
  8.     local h = http.get(BASE .. fname)
  9.     if not h then
  10.         error('Unable to download ' .. fname .. '.lua')
  11.     end
  12.     local c = h.readAll()
  13.     h.close()
  14.     return load(c, fname, nil, _ENV)(...)
  15. end
  16.  
  17. function _ENV.require(modname)
  18.     local fname = modname:gsub('%.', '/')
  19.  
  20.     if not loaded[modname] then
  21.         print('Loading: ' .. fname .. '.lua')
  22.         loaded[modname] = run('modules/' .. fname .. '.lua', modname, _ENV)
  23.     end
  24.     return loaded[modname]
  25. end
  26.  
  27. _G.requireInjector = function() end
  28. run('init/2.vfs.lua')
  29. fs.mount('sys', 'gitfs', 'kepler155c/opus/develop-1.8/sys')
  30.  
  31. print('Starting Opus...')
  32. _ENV.shell.run('/sys/boot/opus.boot')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement