From dba4b10a4559e0efaaabeee4d82a34eab5311e88 Mon Sep 17 00:00:00 2001 From: leaf corcoran Date: Thu, 26 Sep 2019 10:25:01 -0700 Subject: [PATCH] exit with error code when code run with moon fails --- bin/moon | 5 +++-- bin/moon.moon | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/moon b/bin/moon index 5e5e425..75f2156 100755 --- a/bin/moon +++ b/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() diff --git a/bin/moon.moon b/bin/moon.moon index 71bdafb..94601d5 100644 --- a/bin/moon.moon +++ b/bin/moon.moon @@ -90,6 +90,7 @@ run = -> err, util.trim trace }, "\n" + os.exit 1 else if cov cov\stop!