Fixed $in in where blocks (#6976)

This commit is contained in:
Leon
2022-11-10 08:05:15 +10:00
committed by GitHub
parent c600c1ebe7
commit 2c238aea6a
13 changed files with 103 additions and 1 deletions

View File

@ -93,6 +93,9 @@ impl Command for For {
Ok(ListStream::from_stream(vals.into_iter(), ctrlc.clone())
.enumerate()
.map(move |(idx, x)| {
// with_env() is used here to ensure that each iteration uses
// a different set of environment variables.
// Hence, a 'cd' in the first loop won't affect the next loop.
stack.with_env(&orig_env_vars, &orig_env_hidden);
stack.add_var(
@ -134,6 +137,9 @@ impl Command for For {
.into_range_iter(ctrlc.clone())?
.enumerate()
.map(move |(idx, x)| {
// with_env() is used here to ensure that each iteration uses
// a different set of environment variables.
// Hence, a 'cd' in the first loop won't affect the next loop.
stack.with_env(&orig_env_vars, &orig_env_hidden);
stack.add_var(