fix(cli): exit 1 when number_of_diagnostics > 0

This commit is contained in:
Boshen 2023-03-12 12:00:30 +08:00
parent a6cb5fc579
commit d8ff7ab022
No known key found for this signature in database
GPG key ID: 6AC90C77AAAA6ABC

View file

@ -41,11 +41,12 @@ impl Termination for CliRunResult {
return ExitCode::from(1);
}
if number_of_files > 0 {
println!("Found {number_of_diagnostics} diagnostics.");
if number_of_diagnostics > 0 {
println!("Found {number_of_diagnostics} errors.");
return ExitCode::from(1);
}
println!("Found no errors.");
ExitCode::from(0)
}
}