@@ -442,11 +442,15 @@ pub fn parse_esp_idf_json(idf_json_path: &str) -> Result<()> {
442442 let idf_path = value. path ;
443443 let python = value. python ;
444444 let tools_path = config. idf_tools_path . clone ( ) ;
445+ let path_for_activation_script = idf_json_path. parent ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ;
446+
445447 println ! ( "IDF tools path: {}" , tools_path) ;
446448 println ! ( "IDF version: {}" , idf_version) ;
449+ println ! ( "activation script path: {}" , path_for_activation_script) ;
450+ println ! ( "Python path: {}" , python) ;
447451 let export_paths = vec ! [ config. git_path. clone( ) ] ;
448452 match import_single_version (
449- idf_json_path . parent ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ,
453+ path_for_activation_script ,
450454 & idf_path,
451455 & idf_version,
452456 & tools_path,
@@ -575,7 +579,7 @@ pub fn import_single_version(path_to_create_activation_script: &str,idf_location
575579 return Ok ( ( ) ) ;
576580 } ;
577581 let python_env = python. clone ( ) . and_then ( |s| {
578- s. find ( "python_env " ) . map ( |index| s[ ..=index+ 9 ] . to_string ( ) )
582+ s. find ( "bin " ) . map ( |index| s[ ..=index- 1 ] . to_string ( ) )
579583 } ) ;
580584 single_version_post_install (
581585 path_to_create_activation_script,
@@ -592,7 +596,7 @@ pub fn import_single_version(path_to_create_activation_script: &str,idf_location
592596 ) ,
593597 _ => format ! (
594598 "{}/activate_idf_{}.sh" ,
595- path_to_create_activation_script,
599+ PathBuf :: from ( path_to_create_activation_script) . parent ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ,
596600 idf_version
597601 ) ,
598602 } ;
0 commit comments