Posted 05 January 2016 - 05:28 AM
I don't see anything else about this and I'm very curious what the difference is, and what I want to use where.
-- program.lua
sandboxedGlobal = 3
-- run program.lua
local env = {}
os.run(env, "program.lua")
print(env.sandboxedGlobal) -- 3
-- shellProgram.lua
print(globalString)
globalString = shell.getRunningProgram())
-- run shellProgram.lua
globalString = "Hello!"
shell.run("shellProgram.lua") -- prints "Hello!"
print(globalString) -- prints "path/to/shellProgram.lua"
globalVariable = "Hello!"
shell.run("shell shellProgram.lua")
print(globalVariable) -- prints "Hello!"
What "buggy behavior" occurs with passing the "shell" into something with os.run? I'm a bit confused what that actually means.
What "buggy behavior" occurs with passing the "shell" into something with os.run? I'm a bit confused what that actually means.
Well, for one shell.getRunningProgram will return the wrong program name, since you're passing it the shell instance that your program got.