mirror of
https://github.com/nushell/nushell.git
synced 2025-07-03 08:03:32 +02:00
Fixed $in in where
blocks (#6976)
This commit is contained in:
@ -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(
|
||||
|
Reference in New Issue
Block a user