mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 06:37:46 +00:00
conda activate should expand $env.PATH to a connection of absolute paths (#998)
Noticed an issue in `conda.nu`. It modified `$env.PATH` from list of string to a string, without **expanding** it. It may be a problem if I have a path which is relative: ```nushell $env.PATH = ($env.PATH | split row (char esep) | prepend '~/.cargo/bin') ``` After activating an env, it's impossible to find executables in `~/.cargo/bin`. So this pr is going to make sure the path is expanded while converting. For more context: https://github.com/nushell/nushell/pull/14615?notification_referrer_id=NT_kwDOAVOaGrQxMzkwODcxMjU3NjoyMjI1NjE1NA#issuecomment-2552696978
This commit is contained in:
parent
270aa5ce44
commit
be6411ef4a
1 changed files with 2 additions and 2 deletions
|
@ -139,7 +139,7 @@ def conda-create-path-unix [env_dir: path] {
|
|||
([$env_dir "bin"] | path join)
|
||||
]
|
||||
|
||||
let new_path = ([$env_path $env.PATH]
|
||||
let new_path = ([$env_path (system-path)]
|
||||
| flatten
|
||||
| str join (char esep))
|
||||
|
||||
|
@ -151,7 +151,7 @@ def windows? [] {
|
|||
}
|
||||
|
||||
def system-path [] {
|
||||
if "PATH" in $env { $env.PATH } else { $env.Path }
|
||||
if "PATH" in $env { $env.PATH } else { $env.Path } | path expand -n
|
||||
}
|
||||
|
||||
def has-env [name: string] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue