mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 11:48:02 -04:00
Giving a clearer error message if programs cannot be started because the set shell cannot be found, closes #470.
This commit is contained in:
parent
a08fa3be5d
commit
16d0062a9f
@ -11,7 +11,11 @@ local aliases = {}
|
||||
local shells = setmetatable({}, {__mode="v"})
|
||||
|
||||
local function getShell()
|
||||
local shellName = shell.resolve(os.getenv("SHELL"), "lua")
|
||||
local shellPath = os.getenv("SHELL") or "/bin/sh"
|
||||
local shellName, reason = shell.resolve(shellPath, "lua")
|
||||
if not shellName then
|
||||
return nil, "cannot resolve shell `" .. shellPath .. "': " .. reason
|
||||
end
|
||||
if shells[shellName] then
|
||||
return shells[shellName]
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user