File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
src/client/interpreter/locators/services Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,12 @@ function parseCondaEnvFileLine(line: string): { name: string; path: string; isAc
95
95
// form as the environment name. lastIndexOf() can also be used but that assumes
96
96
// that `path` does NOT end with 5*spaces.
97
97
let spaceIndex = line . indexOf ( ' ' ) ;
98
+ if ( spaceIndex === - 1 ) {
99
+ // This means the environment name is longer than 17 characters and it is
100
+ // active. Try ' * ' for separator between name and path.
101
+ spaceIndex = line . indexOf ( ' * ' ) ;
102
+ }
103
+
98
104
if ( spaceIndex > 0 ) {
99
105
// Parsing `name`
100
106
// > `conda create -n <name>`
@@ -117,14 +123,6 @@ function parseCondaEnvFileLine(line: string): { name: string; path: string; isAc
117
123
remainder = line . substring ( spaceIndex ) ;
118
124
}
119
125
120
- // This means the environment name is longer than 17 characters and it is
121
- // active. Try ' * ' for separator between name and path.
122
- if ( spaceIndex === - 1 ) {
123
- spaceIndex = line . indexOf ( ' * ' ) ;
124
- name = line . substring ( 0 , spaceIndex ) . trimRight ( ) ;
125
- remainder = line . substring ( spaceIndex ) ;
126
- }
127
-
128
126
// Detecting Active Environment:
129
127
// Only active environment will have `*` between `name` and `path`. `name`
130
128
// or `path` can have `*` in them as well. So we have to look for `*` in
You can’t perform that action at this time.
0 commit comments