mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
Exit with status 1 on linting error
This commit is contained in:
parent
a9e0874a7a
commit
0262243136
@ -313,15 +313,21 @@ if opts.w then
|
|||||||
|
|
||||||
io.stderr:write("\nQuitting...\n")
|
io.stderr:write("\nQuitting...\n")
|
||||||
elseif opts.l then
|
elseif opts.l then
|
||||||
|
local has_linted_with_error;
|
||||||
for _, tuple in pairs(files) do
|
for _, tuple in pairs(files) do
|
||||||
local fname = tuple[1]
|
local fname = tuple[1]
|
||||||
local res, err = check_compile_or_lint(fname)
|
local res, err = check_compile_or_lint(fname)
|
||||||
if res then
|
if res then
|
||||||
|
has_linted_with_error = true
|
||||||
io.stderr:write(res .. "\n\n")
|
io.stderr:write(res .. "\n\n")
|
||||||
elseif err then
|
elseif err then
|
||||||
|
has_linted_with_error = true
|
||||||
io.stderr:write(fname .. "\n" .. err.. "\n\n")
|
io.stderr:write(fname .. "\n" .. err.. "\n\n")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if has_linted_with_error then
|
||||||
|
os.exit(1)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
for _, tuple in ipairs(files) do
|
for _, tuple in ipairs(files) do
|
||||||
local fname, target = util.unpack(tuple)
|
local fname, target = util.unpack(tuple)
|
||||||
|
Loading…
Reference in New Issue
Block a user