diff --git a/bin/moonc b/bin/moonc index 2d70767..99c056b 100755 --- a/bin/moonc +++ b/bin/moonc @@ -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)