Skip to main content

run_streamed

Function run_streamed 

Source
pub fn run_streamed<F: FnMut(&str)>(
    program: &str,
    args: &[&str],
    on_line: F,
) -> CmdResult
Expand description

Run program args..., streaming each stdout/stderr line to on_line as it arrives. Returns the same CmdResult shape as run, but stdout / stderr carry only the trailing 120 lines of each stream (so an anyhow::bail!(…, res.stderr.trim()) caller still reports the real error). on_line runs on the calling thread, so it can borrow non-Send state (the progress sink) freely.