Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenOS '/bin/sh cmd' failing due to lack of env table #3196

Open
wants to merge 4 commits into
base: master-MC1.7.10
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ if #args == 0 then
end
else
-- execute command.
local result = table.pack(sh.execute(...))
local cargs = {...}
-- sh can run as a shell command (no env table)
local cenv = _ENV
if type(cargs[1]) == "table" then
-- sh can also run as a manually started process (see /bin/source.lua)
cenv = table.remove(cargs, 1)
end
local result = {sh.execute(cenv, table.unpack(cargs))}
if not result[1] then
error(result[2], 0)
end
Expand Down