mirror of
https://github.com/kepler155c/opus
synced 2025-02-06 04:00:03 +00:00
major oops - fix poluted envs
This commit is contained in:
parent
456d2d301f
commit
3d02230742
@ -10,6 +10,10 @@ local sandboxEnv = setmetatable({ }, { __index = _G })
|
|||||||
for k,v in pairs(_ENV) do
|
for k,v in pairs(_ENV) do
|
||||||
sandboxEnv[k] = v
|
sandboxEnv[k] = v
|
||||||
end
|
end
|
||||||
|
sandboxEnv.package = nil
|
||||||
|
sandboxEnv.require = nil
|
||||||
|
sandboxEnv.arg = nil
|
||||||
|
sandboxEnv._ENV = nil
|
||||||
sandboxEnv.shell = shell
|
sandboxEnv.shell = shell
|
||||||
|
|
||||||
_G.requireInjector(_ENV)
|
_G.requireInjector(_ENV)
|
||||||
@ -291,7 +295,9 @@ function shell.setEnv(name, value)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function shell.getEnv()
|
function shell.getEnv()
|
||||||
return sandboxEnv
|
local env = Util.shallowCopy(sandboxEnv)
|
||||||
|
_G.requireInjector(env)
|
||||||
|
return env
|
||||||
end
|
end
|
||||||
|
|
||||||
function shell.setAlias( _sCommand, _sProgram )
|
function shell.setAlias( _sCommand, _sProgram )
|
||||||
|
@ -151,7 +151,7 @@ function kernel.newRoutine(args)
|
|||||||
}, { __index = Routine })
|
}, { __index = Routine })
|
||||||
|
|
||||||
Util.merge(routine, args)
|
Util.merge(routine, args)
|
||||||
routine.env = args.env or Util.shallowCopy(shell.getEnv())
|
routine.env = args.env or shell.getEnv()
|
||||||
|
|
||||||
return routine
|
return routine
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user