mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 01:05:01 +02:00
Add pipeline redirection support (#4594)
* redirection * Remove commented-out * fix tests * more fixes
This commit is contained in:
@ -95,7 +95,7 @@ pub(crate) fn evaluate(
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
||||
match eval_block(engine_state, &mut stack, &block, input) {
|
||||
match eval_block(engine_state, &mut stack, &block, input, false, false) {
|
||||
Ok(pipeline_data) => {
|
||||
crate::eval_file::print_table_or_error(engine_state, &mut stack, pipeline_data, &config)
|
||||
}
|
||||
|
@ -251,3 +251,9 @@ fn with_env_shorthand_nested_quotes() -> TestResult {
|
||||
"-arg \"hello world\"",
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_redirection_stderr() -> TestResult {
|
||||
// try a nonsense binary
|
||||
run_test(r#"do -i { asdjw4j5cnaabw44rd }; echo done"#, "done")
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ pub(crate) fn eval_source(
|
||||
report_error(&working_set, &err);
|
||||
}
|
||||
|
||||
match eval_block(engine_state, stack, &block, input) {
|
||||
match eval_block(engine_state, stack, &block, input, false, false) {
|
||||
Ok(pipeline_data) => {
|
||||
if let Err(err) = print_pipeline_data(pipeline_data, engine_state, stack) {
|
||||
let working_set = StateWorkingSet::new(engine_state);
|
||||
|
Reference in New Issue
Block a user