Skip to content

Commit

Permalink
🐛 - Fix output of errors and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrolich committed Jul 26, 2023
1 parent 7a00ab0 commit b4a64b0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ pub fn build(filter: &Option<regex::Regex>, path: &str, no_timing: bool) -> Resu
num_dirty_modules,
default_timing.unwrap_or(timing_ast_elapsed).as_secs_f64()
);
println!("{}", &err);
print!("{}", &err);
}
Err(err) => {
logs::finalize(&build_state.project_root, &build_state.packages);
Expand All @@ -1262,7 +1262,7 @@ pub fn build(filter: &Option<regex::Regex>, path: &str, no_timing: bool) -> Resu
CROSS,
default_timing.unwrap_or(timing_ast_elapsed).as_secs_f64()
);
println!("{}", &err);
print!("{}", &err);
clean::cleanup_after_build(&build_state);
return Err(());
}
Expand Down Expand Up @@ -1616,7 +1616,6 @@ pub fn build(filter: &Option<regex::Regex>, path: &str, no_timing: bool) -> Resu
if helpers::contains_ascii_characters(&compile_warnings) {
println!("{}", &compile_warnings);
}
println!("{}", &compile_errors);
println!(
"{}\r{} {}Compiled {} modules in {:.2}s",
LINE_CLEAR,
Expand All @@ -1625,11 +1624,9 @@ pub fn build(filter: &Option<regex::Regex>, path: &str, no_timing: bool) -> Resu
num_compiled_modules,
default_timing.unwrap_or(compile_duration).as_secs_f64()
);
print!("{}", &compile_errors);
return Err(());
} else {
if helpers::contains_ascii_characters(&compile_warnings) {
println!("{}", &compile_warnings);
}
println!(
"{}\r{} {}Compiled {} modules in {:.2}s",
LINE_CLEAR,
Expand All @@ -1638,6 +1635,9 @@ pub fn build(filter: &Option<regex::Regex>, path: &str, no_timing: bool) -> Resu
num_compiled_modules,
default_timing.unwrap_or(compile_duration).as_secs_f64()
);
if helpers::contains_ascii_characters(&compile_warnings) {
print!("{}", &compile_warnings);
}
}

let timing_total_elapsed = timing_total.elapsed();
Expand Down
1 change: 0 additions & 1 deletion tests/snapshots/rename-file-with-interface.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[2/7] ️✅ Found source files in 0.00s
[3/7] 🧹 Cleaning up previous build...[3/7] ️✅ Cleaned 2/9 0.00s
[4/7] ️✅ Parsed 1 source files in 0.00s

[5/7] ️✅ Collected deps in 0.00s
[6/7] ️✅ Compiled 3 modules in 0.00s
[7/7] ️✅ Finished Compilation in 0.00s
Expand Down
1 change: 0 additions & 1 deletion tests/snapshots/rename-file.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
[2/7] 🔍 Finding source files...[2/7] ️✅ Found source files in 0.00s
[3/7] 🧹 Cleaning up previous build...[3/7] ️✅ Cleaned 1/9 0.00s
[4/7] ️✅ Parsed 1 source files in 0.00s

[5/7] ️✅ Collected deps in 0.00s
[6/7] ️✅ Compiled 3 modules in 0.00s
[7/7] ️✅ Finished Compilation in 0.00s
Expand Down
1 change: 0 additions & 1 deletion tests/snapshots/rename-interface-file.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[2/7] ️✅ Found source files in 0.00s
[3/7] 🧹 Cleaning up previous build...[3/7] ️✅ Cleaned 1/9 0.00s
[4/7] ️✅ Parsed 1 source files in 0.00s

[5/7] ️✅ Collected deps in 0.00s
[6/7] ️✅ Compiled 3 modules in 0.00s
[7/7] ️✅ Finished Compilation in 0.00s
Expand Down

0 comments on commit b4a64b0

Please sign in to comment.