mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
exit with error code when code run with moon fails
This commit is contained in:
parent
29a780ecc4
commit
dba4b10a45
5
bin/moon
5
bin/moon
@ -97,13 +97,14 @@ run = function()
|
|||||||
local truncated = errors.truncate_traceback(util.trim(trace))
|
local truncated = errors.truncate_traceback(util.trim(trace))
|
||||||
local rewritten = errors.rewrite_traceback(truncated, err)
|
local rewritten = errors.rewrite_traceback(truncated, err)
|
||||||
if rewritten then
|
if rewritten then
|
||||||
return print_err(rewritten)
|
print_err(rewritten)
|
||||||
else
|
else
|
||||||
return print_err(table.concat({
|
print_err(table.concat({
|
||||||
err,
|
err,
|
||||||
util.trim(trace)
|
util.trim(trace)
|
||||||
}, "\n"))
|
}, "\n"))
|
||||||
end
|
end
|
||||||
|
return os.exit(1)
|
||||||
else
|
else
|
||||||
if cov then
|
if cov then
|
||||||
cov:stop()
|
cov:stop()
|
||||||
|
@ -90,6 +90,7 @@ run = ->
|
|||||||
err,
|
err,
|
||||||
util.trim trace
|
util.trim trace
|
||||||
}, "\n"
|
}, "\n"
|
||||||
|
os.exit 1
|
||||||
else
|
else
|
||||||
if cov
|
if cov
|
||||||
cov\stop!
|
cov\stop!
|
||||||
|
Loading…
Reference in New Issue
Block a user