Exit with status 1 on linting error

This commit is contained in:
AlissaSquared 2016-01-07 17:37:47 -06:00
parent a9e0874a7a
commit 0262243136

View File

@ -313,15 +313,21 @@ if opts.w then
io.stderr:write("\nQuitting...\n")
elseif opts.l then
local has_linted_with_error;
for _, tuple in pairs(files) do
local fname = tuple[1]
local res, err = check_compile_or_lint(fname)
if res then
has_linted_with_error = true
io.stderr:write(res .. "\n\n")
elseif err then
has_linted_with_error = true
io.stderr:write(fname .. "\n" .. err.. "\n\n")
end
end
if has_linted_with_error then
os.exit(1)
end
else
for _, tuple in ipairs(files) do
local fname, target = util.unpack(tuple)