Add error codes to -c (#1361)

This commit is contained in:
Jonathan Turner 2020-02-08 20:04:53 -08:00 committed by GitHub
parent 5f4fae5b06
commit e606407d79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -394,7 +394,19 @@ pub async fn run_pipeline_standalone(pipeline: String) -> Result<(), Box<dyn Err
match line {
LineResult::Success(line) => {
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<dyn Err
});
context.maybe_print_errors(Text::from(line));
std::process::exit(1);
}
_ => {}