|
|
@@ -15,7 +15,7 @@ _G.package = {} |
|
|
|
package.loaded = {computer=computer,component=component,fs=fs,buffer=buffer} |
|
|
|
function require(f,force) -- string boolean -- table -- searches for a library with name *f* and returns what the library returns, if possible. if *force* is set, loads the library even if it is cached |
|
|
|
if not package.loaded[f] or force then |
|
|
|
local lib = os.getenv("LIB") or "/boot/lib" |
|
|
|
local lib = os.getenv("LIB") or "/boot/lib\n/pkg/lib" |
|
|
|
for d in lib:gmatch("[^\n]+") do |
|
|
|
if fs.exists(d.."/"..f) then |
|
|
|
package.loaded[f] = runfile(d.."/"..f) |
|
|
|