File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -320,16 +320,15 @@ def _handle_existing_tool(
320
320
# Wrong version, reinstall - remove similar paths too
321
321
logger .info (f"Reinstalling { tool_name } due to version mismatch" )
322
322
323
- # Remove the main tool directory
324
- safe_remove_directory (paths ['tool_path' ])
325
-
326
- # Also remove similar directories with version suffixes (e.g., xtensa.12232)
327
323
tool_base_name = os .path .basename (paths ['tool_path' ])
328
324
packages_dir = os .path .dirname (paths ['tool_path' ])
329
325
330
- # Remove directories matching pattern like "toolname.*"
326
+ # Remove similar directories with version suffixes FIRST (e.g., xtensa.12232)
331
327
safe_remove_directory_pattern (packages_dir , f"{ tool_base_name } .*" )
332
328
329
+ # Then remove the main tool directory (if it still exists)
330
+ safe_remove_directory (paths ['tool_path' ])
331
+
333
332
return self .install_tool (tool_name , retry_count + 1 )
334
333
335
334
def _configure_arduino_framework (self , frameworks : List [str ]) -> None :
You can’t perform that action at this time.
0 commit comments