From e606407d7998738f0daef812e11d0569827d45e4 Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Sat, 8 Feb 2020 20:04:53 -0800 Subject: [PATCH] Add error codes to -c (#1361) --- src/cli.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/cli.rs b/src/cli.rs index e28553f9c7..3cf846ba72 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -394,7 +394,19 @@ pub async fn run_pipeline_standalone(pipeline: String) -> Result<(), Box { + let error_code = { + let errors = context.current_errors.clone(); + let errors = errors.lock(); + + if errors.len() > 0 { + 1 + } else { + 0 + } + }; + context.maybe_print_errors(Text::from(line)); + std::process::exit(error_code); } LineResult::Error(line, err) => { @@ -403,6 +415,7 @@ pub async fn run_pipeline_standalone(pipeline: String) -> Result<(), Box {}