|
1 | 1 | use crate::{ |
2 | | - command_executor::execute_command, idf_config::{IdfConfig, IdfInstallation}, idf_tools::{self, read_and_parse_tools_file}, replace_unescaped_spaces_win, settings::Settings, single_version_post_install, version_manager::get_default_config_path |
| 2 | + command_executor::execute_command, idf_config::{IdfConfig, IdfInstallation}, idf_tools::{self, read_and_parse_tools_file}, replace_unescaped_spaces_win, settings::{self, Settings}, single_version_post_install, version_manager::get_default_config_path |
3 | 3 | }; |
4 | 4 | use anyhow::{anyhow, Result, Error}; |
5 | 5 | use git2::Repository; |
@@ -407,9 +407,14 @@ pub fn parse_tool_set_config(config_path: &str) -> Result<()> { |
407 | 407 |
|
408 | 408 | let new_activation_script = match std::env::consts::OS { |
409 | 409 | "windows" => format!( |
| 410 | +<<<<<<< HEAD |
410 | 411 | "{}\\Microsoft.{}.PowerShell_profile.ps1", |
411 | 412 | activation_script_path, |
412 | 413 | &tool_set.idf_version |
| 414 | +======= |
| 415 | + "{}\\Microsoft.PowerShell_profile.ps1", |
| 416 | + activation_script_path |
| 417 | +>>>>>>> b06d894 (updated according to changes in the scripts location) |
413 | 418 | ), |
414 | 419 | _ => format!( |
415 | 420 | "{}/activate_idf_{}.sh", |
@@ -498,12 +503,13 @@ pub fn parse_esp_idf_json(idf_json_path: &str) -> Result<()> { |
498 | 503 | let idf_path = value.path; |
499 | 504 | let python = value.python; |
500 | 505 | let tools_path = config.idf_tools_path.clone(); |
501 | | - let path_for_activation_script = idf_json_path.parent().unwrap().to_str().unwrap(); |
| 506 | + let settings = crate::settings::Settings::default(); |
| 507 | + let path_for_activation_script = settings.esp_idf_json_path.clone().unwrap_or_default(); |
502 | 508 |
|
503 | | - println!("IDF tools path: {}", tools_path); |
504 | | - println!("IDF version: {}", idf_version); |
505 | | - println!("activation script path: {}", path_for_activation_script); |
506 | | - println!("Python path: {}", python); |
| 509 | + debug!("IDF tools path: {}", tools_path); |
| 510 | + debug!("IDF version: {}", idf_version); |
| 511 | + debug!("activation script path: {}", &path_for_activation_script); |
| 512 | + debug!("Python path: {}", python); |
507 | 513 | // export paths |
508 | 514 | let tools_json_file = find_by_name_and_extension(Path::new(&idf_path), "tools", "json"); |
509 | 515 | if tools_json_file.is_empty() { |
@@ -534,7 +540,7 @@ pub fn parse_esp_idf_json(idf_json_path: &str) -> Result<()> { |
534 | 540 | .collect(); |
535 | 541 | export_paths.push(config.git_path.clone()); |
536 | 542 | match import_single_version( |
537 | | - path_for_activation_script, |
| 543 | + &path_for_activation_script, |
538 | 544 | &idf_path, |
539 | 545 | &idf_version, |
540 | 546 | &tools_path, |
@@ -680,7 +686,7 @@ pub fn import_single_version(path_to_create_activation_script: &str,idf_location |
680 | 686 | ), |
681 | 687 | _ => format!( |
682 | 688 | "{}/activate_idf_{}.sh", |
683 | | - PathBuf::from(path_to_create_activation_script).parent().unwrap().to_str().unwrap(), |
| 689 | + path_to_create_activation_script, |
684 | 690 | idf_version |
685 | 691 | ), |
686 | 692 | }; |
|
0 commit comments