Skip to content

Commit

Permalink
fix: double print of finish message on errors (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonIsaac authored Oct 8, 2024
1 parent 88f5126 commit c874cca
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mod options;
mod reporter;
mod walk;

use std::{thread, time::Instant};
use std::{process::ExitCode, thread, time::Instant};

extern crate pretty_env_logger;
#[macro_use]
Expand All @@ -18,7 +18,7 @@ use crate::{
};

#[allow(clippy::print_stdout)]
fn main() -> Result<()> {
fn main() -> Result<ExitCode> {
pretty_env_logger::init();
let matches = cli();
let opts = CliOptions::new(matches).and_then(OxbuildOptions::new)?;
Expand Down Expand Up @@ -47,14 +47,12 @@ fn main() -> Result<()> {
"Finished in {:2}ms with {num_errors} errors and {num_warnings} warnings using {num_threads} threads.",
duration.as_millis()
);
} else {
println!(
"Finished in {:2}ms using {num_threads} threads.",
duration.as_millis()
);
}
println!(
"Finished in {:2}ms using {num_threads} threads.",
duration.as_millis()
);

if did_fail {
std::process::exit(1);
}
Ok(())
Ok(ExitCode::from(u8::from(did_fail)))
}

0 comments on commit c874cca

Please sign in to comment.