File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -140,18 +140,18 @@ pub fn get_conda_environment_info(
140140 * This function returns the path to the conda installation that was used to create the environment.
141141 */
142142pub fn get_conda_installation_used_to_create_conda_env ( env_path : & Path ) -> Option < PathBuf > {
143- // Possible the env_path is the root conda install folder.
144- if is_conda_install ( env_path) {
145- return Some ( env_path. to_path_buf ( ) ) ;
146- }
147-
148143 // If this environment is in a folder named `envs`, then the parent directory of `envs` is the root conda install folder.
149144 if let Some ( parent) = env_path. ancestors ( ) . nth ( 2 ) {
150145 if is_conda_install ( parent) {
151146 return Some ( parent. to_path_buf ( ) ) ;
152147 }
153148 }
154149
150+ // Possible the env_path is the root conda install folder.
151+ if is_conda_install ( env_path) {
152+ return Some ( env_path. to_path_buf ( ) ) ;
153+ }
154+
155155 let conda_meta_history = env_path. join ( "conda-meta" ) . join ( "history" ) ;
156156 if let Ok ( reader) = std:: fs:: read_to_string ( conda_meta_history. clone ( ) ) {
157157 if let Some ( line) = reader. lines ( ) . map ( |l| l. trim ( ) ) . find ( |l| {
You can’t perform that action at this time.
0 commit comments