mirror of
https://github.com/nushell/nushell
synced 2024-11-10 15:14:14 +00:00
ensure exit codes in more cases (#4804)
This commit is contained in:
parent
9abb14b5fd
commit
2b3843c7c0
1 changed files with 17 additions and 1 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue