Skip to content

Commit

Permalink
Tweak build summary line on final SuperConsole draw
Browse files Browse the repository at this point in the history
  • Loading branch information
kylewlacy committed Jan 25, 2024
1 parent 6a6230c commit 4e50412
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions crates/brioche/src/reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -812,11 +812,24 @@ impl superconsole::Component for JobsComponent {
.take(num_terminal_lines);

let elapsed = self.start.elapsed().human_duration();
let summary_line = format!(
"[{elapsed}] {num_complete_jobs} / {num_jobs}{or_more} job{s} complete",
s = if num_jobs == 1 { "" } else { "s" },
or_more = if is_evaluating { "+" } else { "" },
);
let summary_line = match mode {
superconsole::DrawMode::Normal => {
format!(
"[{elapsed}] {num_complete_jobs} / {num_jobs}{or_more} job{s} complete",
s = if num_jobs == 1 { "" } else { "s" },
or_more = if is_evaluating { "+" } else { "" },
)
}
superconsole::DrawMode::Final => {
let jobs_message = match num_jobs {
0 => "(no new jobs)".to_string(),
1 => "1 job".to_string(),
n => format!("{n} jobs"),
};
format!("Build finished, completed {jobs_message} in {elapsed}")
}
};

let summary_line = superconsole::Line::from_iter([summary_line.try_into().unwrap()]);

let lines = terminal_lines
Expand Down

0 comments on commit 4e50412

Please sign in to comment.