forked from extern/nushell
Add support for optional list stream output formatting (#6325)
* add support for optional list stream output formatting * cargo fmt * table: add ValueFormatter test
This commit is contained in:
@ -109,7 +109,7 @@ pub fn print_table_or_error(
|
||||
|
||||
// Make sure everything has finished
|
||||
if let Some(exit_code) = exit_code {
|
||||
let mut exit_code: Vec<_> = exit_code.into_iter().collect();
|
||||
let mut exit_code: Vec<_> = exit_code.into_iter().map(|(value, _)| value).collect();
|
||||
exit_code
|
||||
.pop()
|
||||
.and_then(|last_exit_code| match last_exit_code {
|
||||
|
@ -233,7 +233,7 @@ pub fn eval_source(
|
||||
match eval_block(engine_state, stack, &block, input, false, false) {
|
||||
Ok(mut pipeline_data) => {
|
||||
if let PipelineData::ExternalStream { exit_code, .. } = &mut pipeline_data {
|
||||
if let Some(exit_code) = exit_code.take().and_then(|it| it.last()) {
|
||||
if let Some((exit_code, _)) = exit_code.take().and_then(|it| it.last()) {
|
||||
stack.add_env_var("LAST_EXIT_CODE".to_string(), exit_code);
|
||||
} else {
|
||||
set_last_exit_code(stack, 0);
|
||||
|
Reference in New Issue
Block a user