allow par-each to receive $in (#5229)

Co-authored-by: Yethal <nosuchemail@email.com>
This commit is contained in:
Yethal 2022-04-19 00:02:58 +02:00 committed by GitHub
parent e206555d9d
commit 409f1480f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,13 +92,13 @@ impl Command for ParEach {
val: idx as i64, val: idx as i64,
span, span,
}, },
x, x.clone(),
], ],
span, span,
}, },
); );
} else { } else {
stack.add_var(*var_id, x); stack.add_var(*var_id, x.clone());
} }
} }
} }
@ -107,7 +107,7 @@ impl Command for ParEach {
&engine_state, &engine_state,
&mut stack, &mut stack,
block, block,
PipelineData::new(span), x.into_pipeline_data(),
redirect_stdout, redirect_stdout,
redirect_stderr, redirect_stderr,
) { ) {
@ -140,13 +140,13 @@ impl Command for ParEach {
val: idx as i64, val: idx as i64,
span, span,
}, },
x, x.clone(),
], ],
span, span,
}, },
); );
} else { } else {
stack.add_var(*var_id, x); stack.add_var(*var_id, x.clone());
} }
} }
} }
@ -155,7 +155,7 @@ impl Command for ParEach {
&engine_state, &engine_state,
&mut stack, &mut stack,
block, block,
PipelineData::new(span), x.into_pipeline_data(),
redirect_stdout, redirect_stdout,
redirect_stderr, redirect_stderr,
) { ) {
@ -187,13 +187,13 @@ impl Command for ParEach {
val: idx as i64, val: idx as i64,
span, span,
}, },
x, x.clone(),
], ],
span, span,
}, },
); );
} else { } else {
stack.add_var(*var_id, x); stack.add_var(*var_id, x.clone());
} }
} }
} }
@ -202,7 +202,7 @@ impl Command for ParEach {
&engine_state, &engine_state,
&mut stack, &mut stack,
block, block,
PipelineData::new(span), x.into_pipeline_data(),
redirect_stdout, redirect_stdout,
redirect_stderr, redirect_stderr,
) { ) {
@ -243,13 +243,13 @@ impl Command for ParEach {
val: idx as i64, val: idx as i64,
span, span,
}, },
x, x.clone(),
], ],
span, span,
}, },
); );
} else { } else {
stack.add_var(*var_id, x); stack.add_var(*var_id, x.clone());
} }
} }
} }
@ -258,7 +258,7 @@ impl Command for ParEach {
&engine_state, &engine_state,
&mut stack, &mut stack,
block, block,
PipelineData::new(span), x.into_pipeline_data(),
redirect_stdout, redirect_stdout,
redirect_stderr, redirect_stderr,
) { ) {
@ -275,7 +275,7 @@ impl Command for ParEach {
if let Some(var) = block.signature.get_positional(0) { if let Some(var) = block.signature.get_positional(0) {
if let Some(var_id) = &var.var_id { if let Some(var_id) = &var.var_id {
stack.add_var(*var_id, x); stack.add_var(*var_id, x.clone());
} }
} }
@ -283,7 +283,7 @@ impl Command for ParEach {
&engine_state, &engine_state,
&mut stack, &mut stack,
block, block,
PipelineData::new(span), x.into_pipeline_data(),
redirect_stdout, redirect_stdout,
redirect_stderr, redirect_stderr,
) )