neonucleus/data/OpenOS/lib/core/full_shell.lua
IonutParau 687cfebd00 testing version of LuaBIOS and OpenOS
people were having issues getting them to work so now we promote consistency
2025-06-28 20:41:49 +02:00

26 lines
606 B
Lua

local shell = require("shell")
local process = require("process")
function shell.aliases()
return pairs(process.info().data.aliases)
end
function shell.execute(command, env, ...)
local sh, reason = shell.getShell()
if not sh then
return false, reason
end
local proc = process.load(sh, nil, nil, command)
local result = table.pack(process.internal.continue(proc, env, command, ...))
if result.n == 0 then return true end
return table.unpack(result, 1, result.n)
end
function shell.getPath()
return os.getenv("PATH")
end
function shell.setPath(value)
os.setenv("PATH", value)
end