1
0
mirror of https://github.com/kepler155c/opus synced 2025-12-19 22:58:06 +00:00

require cleanup + compatibility fixes

This commit is contained in:
kepler155c@gmail.com
2020-06-11 13:28:43 -06:00
parent 1bf6daedff
commit a2af4405e7
4 changed files with 17 additions and 23 deletions

View File

@@ -165,9 +165,9 @@ function kernel.getShell()
end
-- each routine inherits the parent's env
function kernel.makeEnv(env)
function kernel.makeEnv(env, dir)
env = setmetatable(Util.shallowCopy(env or _ENV), { __index = _G })
_G.requireInjector(env)
_G.requireInjector(env, dir)
return env
end
@@ -182,7 +182,7 @@ function kernel.newRoutine(env, args)
}, { __index = Routine })
Util.merge(routine, args)
routine.env = args.env or kernel.makeEnv(env)
routine.env = args.env or kernel.makeEnv(env, routine.path and fs.getDir(routine.path))
routine.terminal = routine.terminal or routine.window
return routine