pub async fn execute_with<F>(
exec: impl FnOnce(UnboundedSender<Vec<u8>>) -> F,
cancel: &CancellationToken,
on_chunk: impl FnMut(&str),
) -> Result<BashResult, String>Expand description
pi’s executeBashWithOperations: runs a command through exec, which
sends its output to the sender it gets and returns the exit code, and
collects the output as execute does. A run that fails or ends after
cancel fired is cancelled.