Skip to content

Commit

Permalink
Explicitly call done on timer
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Jan 21, 2025
1 parent 1593653 commit 38d11e7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions shared/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ pub fn print_error(title: impl AsRef<str>, body: impl Into<BuildpackOutputText>)
pub fn run_command(mut command: Command, quiet: bool) -> Result<Output, CmdError> {
let title = format!("Running {}", style::value(command.name()));
if quiet {
let _timer = print::sub_start_timer(title);
command.named_output()
let timer = print::sub_start_timer(title);
let output = command.named_output();
let _ = timer.done();
output
} else {
print::sub_stream_with(&title, |stdout, stderr| {
command.stream_output(stdout, stderr)
Expand Down Expand Up @@ -210,8 +212,10 @@ pub fn track_timing_subsection<F, E>(title: impl Into<BuildpackOutputText>, f: F
where
F: FnOnce() -> E,
{
let _timer = print::sub_start_timer(title.into().to_ansi_string());
f()
let timer = print::sub_start_timer(title.into().to_ansi_string());
let output = f();
let _ = timer.done();
output
}

const VALUE_DELIMITER_CHAR: char = '`';
Expand Down

0 comments on commit 38d11e7

Please sign in to comment.