|
77 | 77 | if IS_WINDOWS: |
78 | 78 | os.environ["PLATFORMIO_SYSTEM_TYPE"] = "windows_amd64" |
79 | 79 |
|
80 | | -# Clear IDF_TOOLS_PATH, if set tools may be installed in the wrong place |
81 | | -os.environ["IDF_TOOLS_PATH"] = "" |
| 80 | +# Set IDF_TOOLS_PATH to Pio core_dir |
| 81 | +PROJECT_CORE_DIR=ProjectConfig.get_instance().get("platformio", "core_dir") |
| 82 | +IDF_TOOLS_PATH=os.path.join(PROJECT_CORE_DIR) |
| 83 | +os.environ["IDF_TOOLS_PATH"] = IDF_TOOLS_PATH |
82 | 84 |
|
83 | 85 | # Global variables |
84 | 86 | python_exe = get_pythonexe_path() |
@@ -478,19 +480,16 @@ def _install_with_idf_tools(self, tool_name: str, paths: Dict[str, str]) -> bool |
478 | 480 | return False |
479 | 481 |
|
480 | 482 | # Copy tool files |
481 | | - tools_path_default = os.path.join( |
482 | | - os.path.expanduser("~"), ".platformio" |
483 | | - ) |
484 | 483 | target_package_path = os.path.join( |
485 | | - tools_path_default, "tools", tool_name, "package.json" |
| 484 | + IDF_TOOLS_PATH, "tools", tool_name, "package.json" |
486 | 485 | ) |
487 | 486 |
|
488 | 487 | if not safe_copy_file(paths['package_path'], target_package_path): |
489 | 488 | return False |
490 | 489 |
|
491 | 490 | safe_remove_directory(paths['tool_path']) |
492 | 491 |
|
493 | | - tl_path = f"file://{os.path.join(tools_path_default, 'tools', tool_name)}" |
| 492 | + tl_path = f"file://{os.path.join(IDF_TOOLS_PATH, 'tools', tool_name)}" |
494 | 493 | pm.install(tl_path) |
495 | 494 |
|
496 | 495 | logger.info(f"Tool {tool_name} successfully installed") |
|
0 commit comments