Stdout/Stderr redirection (#7185)

This adds new pipeline connectors called out> and err> which redirect either stdout or stderr to a file. You can also use out+err> (or err+out>) to redirect both streams into a file.
This commit is contained in:
JT
2022-11-23 07:26:13 +13:00
committed by GitHub
parent c9f9078726
commit 74a73f9838
15 changed files with 856 additions and 346 deletions

View File

@ -53,6 +53,20 @@ impl RawStream {
Ok(Spanned { item: output, span })
}
pub fn chain(self, stream: RawStream) -> RawStream {
RawStream {
stream: Box::new(self.stream.chain(stream.stream)),
leftover: self
.leftover
.into_iter()
.chain(stream.leftover.into_iter())
.collect(),
ctrlc: self.ctrlc,
is_binary: self.is_binary,
span: self.span,
}
}
}
impl Debug for RawStream {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {