1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-15 07:47:40 +00:00

require improvements, remove global Util

This commit is contained in:
kepler155c@gmail.com
2017-09-05 02:09:31 -04:00
parent 2b1d96ab37
commit ae7508e89b
82 changed files with 506 additions and 455 deletions

View File

@@ -1,9 +1,16 @@
local parentShell = shell
shell = { }
local sandboxEnv = Util.shallowCopy(getfenv(1))
local sandboxEnv = { }
for k,v in pairs(getfenv(1)) do
sandboxEnv[k] = v
end
setmetatable(sandboxEnv, { __index = _G })
requireInjector(getfenv(1))
local Util = require('util')
local DIR = (parentShell and parentShell.dir()) or ""
local PATH = (parentShell and parentShell.path()) or ".:/rom/programs"
local ALIASES = (parentShell and parentShell.aliases()) or {}
@@ -223,8 +230,7 @@ if #tArgs > 0 then
return s, m
end
require = requireInjector(getfenv(1))
local Config = require('config')
local Config = require('config')
local History = require('history')
local config = {