ensure exit codes in more cases (#4804)

This commit is contained in:
JT 2022-03-10 07:32:46 -05:00 committed by GitHub
parent 9abb14b5fd
commit 2b3843c7c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -93,9 +93,20 @@ impl PipelineData {
vals: s.collect(), vals: s.collect(),
span, // FIXME? span, // FIXME?
}, },
PipelineData::ExternalStream { stdout: None, .. } => Value::Nothing { span }, PipelineData::ExternalStream {
stdout: None,
exit_code,
..
} => {
// Make sure everything has finished
if let Some(exit_code) = exit_code {
let _: Vec<_> = exit_code.into_iter().collect();
}
Value::Nothing { span }
}
PipelineData::ExternalStream { PipelineData::ExternalStream {
stdout: Some(mut s), stdout: Some(mut s),
exit_code,
.. ..
} => { } => {
let mut items = vec![]; let mut items = vec![];
@ -111,6 +122,11 @@ impl PipelineData {
} }
} }
// Make sure everything has finished
if let Some(exit_code) = exit_code {
let _: Vec<_> = exit_code.into_iter().collect();
}
if s.is_binary { if s.is_binary {
let mut output = vec![]; let mut output = vec![];
for item in items { for item in items {