make file loading errors that happen late in compilation still fatal

This commit is contained in:
Brendan Hansknecht 2023-04-04 20:16:19 -07:00
parent 21d063da26
commit 8f4945f286
No known key found for this signature in database
GPG key ID: 0EA784685083E75B
9 changed files with 189 additions and 114 deletions

View file

@ -730,6 +730,16 @@ pub fn build(
Ok(problems.exit_code())
}
BuildAndRun => {
if problems.fatally_errored {
problems.print_to_stdout(total_time);
println!(
".\n\nCannot run program due to fatal error…\n\n\x1B[36m{}\x1B[39m",
"".repeat(80)
);
// Return a nonzero exit code due to falta problem
return Ok(problems.exit_code());
}
if problems.errors > 0 || problems.warnings > 0 {
problems.print_to_stdout(total_time);
println!(