mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 19:27:44 +02:00
Properly redirect invocations (#2070)
* Properly redirect invocations * Don't convert with-env yet, as there's a random test failure
This commit is contained in:
@ -61,16 +61,18 @@ async fn do_(
|
||||
registry: &CommandRegistry,
|
||||
) -> Result<OutputStream, ShellError> {
|
||||
let registry = registry.clone();
|
||||
let is_last = raw_args.call_info.args.is_last;
|
||||
|
||||
let mut context = Context::from_raw(&raw_args, ®istry);
|
||||
let scope = raw_args.call_info.scope.clone();
|
||||
let (
|
||||
DoArgs {
|
||||
ignore_errors,
|
||||
block,
|
||||
mut block,
|
||||
},
|
||||
input,
|
||||
) = raw_args.process(®istry).await?;
|
||||
block.set_is_last(!is_last);
|
||||
|
||||
let result = run_block(
|
||||
&block,
|
||||
|
@ -40,7 +40,9 @@ impl WholeStreamCommand for AliasCommand {
|
||||
) -> Result<OutputStream, ShellError> {
|
||||
let call_info = args.call_info.clone();
|
||||
let registry = registry.clone();
|
||||
let block = self.block.clone();
|
||||
let mut block = self.block.clone();
|
||||
block.set_is_last(!call_info.args.is_last);
|
||||
|
||||
let alias_command = self.clone();
|
||||
let mut context = Context::from_args(&args, ®istry);
|
||||
let input = args.input;
|
||||
|
@ -196,6 +196,9 @@ async fn evaluate_invocation(
|
||||
|
||||
let input = InputStream::empty();
|
||||
|
||||
let mut block = block.clone();
|
||||
block.set_is_last(true);
|
||||
|
||||
let result = run_block(&block, &mut context, input, it, vars, env).await?;
|
||||
|
||||
let output = result.into_vec().await;
|
||||
|
Reference in New Issue
Block a user