Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure exit codes in more cases #4804

Merged
merged 1 commit into from
Mar 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
ensure exit codes in more cases
  • Loading branch information
sophiajt committed Mar 10, 2022
commit ffddb620df45a45ec3f59cea025e360efe34aebb
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