Skip to content

Commit 2f14240

Browse files
dedebenuiBenoît Sierro
andauthored
changed insert to merge (nushell#399)
updating the environment with closures should not be done with `insert` because `insert` will call a closure if it gets one as input, `merge` will not Co-authored-by: Benoît Sierro <[email protected]>
1 parent bc71f8d commit 2f14240

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

virtual_environments/conda.nu

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,15 @@ export def-env activate [
5353
{|| $'($virtual_prompt)' }
5454
}
5555

56-
$new_env
57-
| insert CONDA_OLD_PROMPT_COMMAND $old_prompt_command
58-
| insert PROMPT_COMMAND $new_prompt
56+
$new_env | merge {
57+
CONDA_OLD_PROMPT_COMMAND: $old_prompt_command
58+
PROMPT_COMMAND: $new_prompt
59+
}
5960
} else {
60-
$new_env
61-
| insert CONDA_OLD_PROMPT_COMMAND $nothing
61+
$new_env | merge { CONDA_OLD_PROMPT_COMMAND: $nothing }
6262
}
6363

64+
6465
load-env $new_env
6566
}
6667

0 commit comments

Comments
 (0)