mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 08:45:45 +02:00
feat: coredump (#6791)
fix issue in https://github.com/nushell/nushell/issues/5903 return Error to pipeline_data, if match error, then return error directly
This commit is contained in:
@ -445,9 +445,12 @@ impl PipelineData {
|
||||
// Make sure everything has finished
|
||||
if let Some(exit_code) = exit_code {
|
||||
let mut exit_codes: Vec<_> = exit_code.into_iter().collect();
|
||||
if let Some(Value::Int { val, .. }) = exit_codes.pop() {
|
||||
return Ok(val);
|
||||
}
|
||||
return match exit_codes.pop() {
|
||||
#[cfg(unix)]
|
||||
Some(Value::Error { error }) => Err(error),
|
||||
Some(Value::Int { val, .. }) => Ok(val),
|
||||
_ => Ok(0),
|
||||
};
|
||||
}
|
||||
|
||||
return Ok(0);
|
||||
|
Reference in New Issue
Block a user