@@ -181,15 +181,11 @@ fn get_known_conda_locations(environment: &impl known::Environment) -> Vec<PathB
181
181
PathBuf :: from( "/home/miniconda3/bin" ) ,
182
182
PathBuf :: from( "/anaconda3/bin" ) ,
183
183
PathBuf :: from( "/miniconda3/bin" ) ,
184
- PathBuf :: from( "/usr/local/anaconda3/bin" ) ,
185
- PathBuf :: from( "/usr/local/miniconda3/bin" ) ,
186
- PathBuf :: from( "/usr/anaconda3/bin" ) ,
187
- PathBuf :: from( "/usr/miniconda3/bin" ) ,
188
- PathBuf :: from( "/home/anaconda3/bin" ) ,
189
- PathBuf :: from( "/home/miniconda3/bin" ) ,
190
- PathBuf :: from( "/anaconda3/bin" ) ,
191
- PathBuf :: from( "/miniconda3/bin" ) ,
192
184
] ;
185
+ if let Some ( home) = environment. get_user_home ( ) {
186
+ known_paths. push ( PathBuf :: from ( home. clone ( ) ) . join ( "anaconda3/bin" ) ) ;
187
+ known_paths. push ( PathBuf :: from ( home) . join ( "miniconda3/bin" ) ) ;
188
+ }
193
189
known_paths. append ( & mut environment. get_know_global_search_locations ( ) ) ;
194
190
known_paths
195
191
}
@@ -201,9 +197,10 @@ fn find_conda_binary_in_known_locations(environment: &impl known::Environment) -
201
197
for location in known_locations {
202
198
for bin in & conda_bin_names {
203
199
let conda_path = location. join ( bin) ;
204
- let metadata = std:: fs:: metadata ( & conda_path) . ok ( ) ?;
205
- if metadata. is_file ( ) || metadata. is_symlink ( ) {
206
- return Some ( conda_path) ;
200
+ if let Some ( metadata) = std:: fs:: metadata ( & conda_path) . ok ( ) {
201
+ if metadata. is_file ( ) || metadata. is_symlink ( ) {
202
+ return Some ( conda_path) ;
203
+ }
207
204
}
208
205
}
209
206
}
0 commit comments