Skip to content

Commit

Permalink
ensure exit codes in more cases (#4804)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiajt committed Mar 10, 2022
1 parent 9abb14b commit 2b3843c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion crates/nu-protocol/src/pipeline_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,20 @@ impl PipelineData {
vals: s.collect(),
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 {
stdout: Some(mut s),
exit_code,
..
} => {
let mut items = vec![];
Expand All @@ -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 {
let mut output = vec![];
for item in items {
Expand Down

0 comments on commit 2b3843c

Please sign in to comment.