Update process.lua

This commit is contained in:
Robert Jelic
2023-01-08 10:04:00 +01:00
committed by GitHub
parent a4d0492d17
commit 94fccf9211

View File

@@ -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