Skip to content

Commit be6411e

Browse files
authored
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: nushell/nushell#14615
1 parent 270aa5c commit be6411e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/virtual_environments/conda.nu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def conda-create-path-unix [env_dir: path] {
139139
([$env_dir "bin"] | path join)
140140
]
141141

142-
let new_path = ([$env_path $env.PATH]
142+
let new_path = ([$env_path (system-path)]
143143
| flatten
144144
| str join (char esep))
145145

@@ -151,7 +151,7 @@ def windows? [] {
151151
}
152152

153153
def system-path [] {
154-
if "PATH" in $env { $env.PATH } else { $env.Path }
154+
if "PATH" in $env { $env.PATH } else { $env.Path } | path expand -n
155155
}
156156

157157
def has-env [name: string] {

0 commit comments

Comments
 (0)