fix ls exit code when piping

This commit is contained in:
payonel 2017-05-23 00:29:35 -07:00
parent 0543d0eaf5
commit 1a4e15b0a6
2 changed files with 4 additions and 2 deletions

View File

@ -4,7 +4,10 @@ local ok, why = pcall(function(...)
return loadfile("/opt/core/full_ls.lua", "bt", _G)(...)
end, ...)
if not ok then
if not ok then
if type(why) == "table" and why.code == 0 then
return
end
io.stderr:write((why or "") .. "\nFor low memory systems, try using `list` instead\n")
return 1
end

View File

@ -2,7 +2,6 @@ local computer = require("computer")
local event = require("event")
local fs = require("filesystem")
local shell = require("shell")
local unicode = require("unicode")
local process = require("process")
local function env()