Skip to content

Commit 9e361f0

Browse files
committed
added tool_set.json file parsing to the discovery
1 parent d9e557f commit 9e361f0

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

src-tauri/src/cli/mod.rs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ pub async fn run_cli(cli: Cli) {
314314
debug!("No path provided, using default: {}", default_path);
315315
default_path
316316
});
317-
// first parse existing esp_idf.json (using parse_esp_idf_json)
318-
317+
// first parse existing esp_idf.json (using parse_esp_idf_json) || previous VSCode installations
318+
info!("Searching for esp_idf.json files...");
319319
let search_patch = Path::new(&path);
320320
let esp_idf_json_path = find_by_name_and_extension(
321321
search_patch,
@@ -338,6 +338,31 @@ pub async fn run_cli(cli: Cli) {
338338
}
339339
}
340340
}
341+
// second try to find tool_set_config.json (using parse_tool_set_config) || previous Eclipse installations
342+
info!("Searching for tool_set_config.json files...");
343+
let tool_set_config_path = find_by_name_and_extension(
344+
search_patch,
345+
"tool_set_config",
346+
"json",
347+
);
348+
if tool_set_config_path.is_empty() {
349+
info!("No tool_set_config.json found");
350+
} else {
351+
info!("Found {} tool_set_config.json files:", tool_set_config_path.len());
352+
}
353+
for path in tool_set_config_path {
354+
info!("- {} ", &path);
355+
match idf_im_lib::utils::parse_tool_set_config(&path) {
356+
Ok(_) => {
357+
info!("Parsed config: {:?}", path);
358+
}
359+
Err(err) => {
360+
info!("Failed to parse tool_set_config.json: {}", err);
361+
}
362+
}
363+
}
364+
// third try to find IDF directories (using find_esp_idf_folders) || previous instalation from cli
365+
info!("Searching for any other IDF directories...");
341366
let idf_dirs = idf_im_lib::version_manager::find_esp_idf_folders(&path);
342367
if idf_dirs.is_empty() {
343368
info!("No IDF directories found");

0 commit comments

Comments
 (0)