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:
Jonathan Turner
2020-06-28 09:04:57 +12:00
committed by GitHub
parent 8b3964f518
commit dffc9c9b1c
5 changed files with 45 additions and 4 deletions

View File

@ -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, &registry);
let scope = raw_args.call_info.scope.clone();
let (
DoArgs {
ignore_errors,
block,
mut block,
},
input,
) = raw_args.process(&registry).await?;
block.set_is_last(!is_last);
let result = run_block(
&block,

View File

@ -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, &registry);
let input = args.input;

View File

@ -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;