diff --git a/platform.json b/platform.json index e35acae6c..5d0e6cdaa 100644 --- a/platform.json +++ b/platform.json @@ -99,8 +99,8 @@ "type": "tool", "optional": false, "owner": "pioarduino", - "package-version": "5.3.0", - "version": "https://github.com/pioarduino/esp_install/releases/download/v5.3.0/esp_install-v5.3.0.zip" + "package-version": "5.3.1", + "version": "https://github.com/pioarduino/esp_install/releases/download/v5.3.1/esp_install-v5.3.1.zip" }, "contrib-piohome": { "optional": true, diff --git a/platform.py b/platform.py index c69e728e7..eb9bfa9da 100644 --- a/platform.py +++ b/platform.py @@ -77,8 +77,10 @@ if IS_WINDOWS: os.environ["PLATFORMIO_SYSTEM_TYPE"] = "windows_amd64" -# Clear IDF_TOOLS_PATH, if set tools may be installed in the wrong place -os.environ["IDF_TOOLS_PATH"] = "" +# Set IDF_TOOLS_PATH to Pio core_dir +PROJECT_CORE_DIR=ProjectConfig.get_instance().get("platformio", "core_dir") +IDF_TOOLS_PATH=os.path.join(PROJECT_CORE_DIR) +os.environ["IDF_TOOLS_PATH"] = IDF_TOOLS_PATH # Global variables python_exe = get_pythonexe_path() @@ -478,11 +480,8 @@ def _install_with_idf_tools(self, tool_name: str, paths: Dict[str, str]) -> bool return False # Copy tool files - tools_path_default = os.path.join( - os.path.expanduser("~"), ".platformio" - ) target_package_path = os.path.join( - tools_path_default, "tools", tool_name, "package.json" + IDF_TOOLS_PATH, "tools", tool_name, "package.json" ) if not safe_copy_file(paths['package_path'], target_package_path): @@ -490,7 +489,7 @@ def _install_with_idf_tools(self, tool_name: str, paths: Dict[str, str]) -> bool safe_remove_directory(paths['tool_path']) - tl_path = f"file://{os.path.join(tools_path_default, 'tools', tool_name)}" + tl_path = f"file://{os.path.join(IDF_TOOLS_PATH, 'tools', tool_name)}" pm.install(tl_path) logger.info(f"Tool {tool_name} successfully installed")