Fix do -p not waiting for external commands (#13881)

# Description
Similar to #13870 (thanks @WindSoilder), this PR adds a boolean which
determines whether to ignore any errors from an external command. This
is in order to fix #13876. I.e., `do -p` does not wait for externals to
complete before continuing.

# User-Facing Changes
Bug fix.

# Tests + Formatting
Added a test.
This commit is contained in:
Ian Manske
2024-09-22 07:26:32 -07:00
committed by GitHub
parent cf5fec63c0
commit cd0d0364ec
4 changed files with 25 additions and 9 deletions

View File

@ -169,7 +169,7 @@ impl Command for Do {
&& !matches!(caller_stack.stdout(), OutDest::Pipe | OutDest::Capture) =>
{
if let ByteStreamSource::Child(child) = stream.source_mut() {
child.set_exit_code(0)
child.ignore_error();
}
Ok(PipelineData::ByteStream(stream, metadata))
}