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 rewritten = errors.rewrite_traceback(truncated, err)
|
||||
if rewritten then
|
||||
return print_err(rewritten)
|
||||
print_err(rewritten)
|
||||
else
|
||||
return print_err(table.concat({
|
||||
print_err(table.concat({
|
||||
err,
|
||||
util.trim(trace)
|
||||
}, "\n"))
|
||||
end
|
||||
return os.exit(1)
|
||||
else
|
||||
if cov then
|
||||
cov:stop()
|
||||
|
@ -90,6 +90,7 @@ run = ->
|
||||
err,
|
||||
util.trim trace
|
||||
}, "\n"
|
||||
os.exit 1
|
||||
else
|
||||
if cov
|
||||
cov\stop!
|
||||
|
Loading…
Reference in New Issue
Block a user