Update process.lua
This commit is contained in:
@@ -17,7 +17,6 @@ function process:new(path, window, newEnv, ...)
|
|||||||
local env = setmetatable(newEnv, {__index=_ENV})
|
local env = setmetatable(newEnv, {__index=_ENV})
|
||||||
env.shell = shell
|
env.shell = shell
|
||||||
env.basaltProgram=true
|
env.basaltProgram=true
|
||||||
env.arg = {[0]=path, table.unpack(args)}
|
|
||||||
env.require, env.package = newPackage(env, fs.getDir(pPath))
|
env.require, env.package = newPackage(env, fs.getDir(pPath))
|
||||||
if(fs.exists(pPath))then
|
if(fs.exists(pPath))then
|
||||||
local file = fs.open(pPath, "r")
|
local file = fs.open(pPath, "r")
|
||||||
@@ -25,7 +24,7 @@ function process:new(path, window, newEnv, ...)
|
|||||||
file.close()
|
file.close()
|
||||||
local program = load(content, path, "bt", env)
|
local program = load(content, path, "bt", env)
|
||||||
if(program~=nil)then
|
if(program~=nil)then
|
||||||
return program()
|
return program(table.unpack(args))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@@ -82,4 +81,4 @@ function process:start()
|
|||||||
coroutine.resume(self.coroutine)
|
coroutine.resume(self.coroutine)
|
||||||
end
|
end
|
||||||
|
|
||||||
return process
|
return process
|
||||||
|
|||||||
Reference in New Issue
Block a user