Skip to content

Commit c9530ae

Browse files
committed
fix env pass in sh command. closes #3196
1 parent 6aee1d6 commit c9530ae

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/resources/assets/opencomputers/loot/openos/bin/sh.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ if #args == 0 then
4141
end
4242
else
4343
-- execute command.
44-
return sh.execute(...)
44+
return sh.execute(_ENV, ...)
4545
end

src/main/resources/assets/opencomputers/loot/openos/lib/core/full_shell.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ function shell.execute(command, env, ...)
1010
if not sh then
1111
return false, reason
1212
end
13-
local proc = process.load(sh, nil, nil, command)
14-
local result = table.pack(process.internal.continue(proc, env, command, ...))
13+
local proc = process.load(sh, env, nil, command)
14+
local result = table.pack(process.internal.continue(proc, command, ...))
1515
if result.n == 0 then return true end
1616
return table.unpack(result, 1, result.n)
1717
end

0 commit comments

Comments
 (0)