1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 22:57:46 +00:00

changed insert to merge (#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 <benoit.sierro@bluewin.ch>
This commit is contained in:
dedebenui 2023-03-08 13:42:58 +01:00 committed by GitHub
parent bc71f8d1e9
commit 2f142406d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,14 +53,15 @@ export def-env activate [
{|| $'($virtual_prompt)' }
}
$new_env
| insert CONDA_OLD_PROMPT_COMMAND $old_prompt_command
| insert PROMPT_COMMAND $new_prompt
$new_env | merge {
CONDA_OLD_PROMPT_COMMAND: $old_prompt_command
PROMPT_COMMAND: $new_prompt
}
} else {
$new_env
| insert CONDA_OLD_PROMPT_COMMAND $nothing
$new_env | merge { CONDA_OLD_PROMPT_COMMAND: $nothing }
}
load-env $new_env
}