mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 09:55:42 +02:00
Fix non-zero exit code errors in middle of pipeline (#13899)
# Description Fixes #13868. Should come after #13885. # User-Facing Changes Bug fix. # Tests + Formatting Added a test.
This commit is contained in:
@ -182,6 +182,8 @@ impl Command for Save {
|
||||
}
|
||||
(None, None) => {}
|
||||
};
|
||||
|
||||
child.wait()?;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -180,12 +180,19 @@ impl Command for External {
|
||||
}
|
||||
|
||||
// Wrap the output into a `PipelineData::ByteStream`.
|
||||
let child = ChildProcess::new(
|
||||
let mut child = ChildProcess::new(
|
||||
child,
|
||||
merged_stream,
|
||||
matches!(stderr, OutDest::Pipe),
|
||||
call.head,
|
||||
)?;
|
||||
|
||||
if matches!(stdout, OutDest::Pipe | OutDest::PipeSeparate)
|
||||
|| matches!(stderr, OutDest::Pipe | OutDest::PipeSeparate)
|
||||
{
|
||||
child.ignore_error(true);
|
||||
}
|
||||
|
||||
Ok(PipelineData::ByteStream(
|
||||
ByteStream::child(child, call.head),
|
||||
None,
|
||||
|
Reference in New Issue
Block a user