Skip to content

Commit c594d41

Browse files
authored
Delete regarding tool folders which contain @before installing tool
1 parent be561a6 commit c594d41

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

platform.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,17 @@ def _get_tool_paths(self, tool_name: str) -> Dict[str, str]:
168168
"""Get centralized path calculation for tools with caching."""
169169
if tool_name not in self._tools_cache:
170170
tool_path = os.path.join(self.packages_dir, tool_name)
171+
# Remove all directories containing '@' in their name
172+
try:
173+
for item in os.listdir(self.packages_dir):
174+
if '@' in item and item.startswith(tool_name):
175+
item_path = os.path.join(self.packages_dir, item)
176+
if os.path.isdir(item_path):
177+
safe_remove_directory(item_path)
178+
logger.debug(f"Removed directory with '@' in name: {item_path}")
179+
except OSError as e:
180+
logger.error(f"Error scanning packages directory for '@' directories: {e}")
181+
171182
self._tools_cache[tool_name] = {
172183
'tool_path': tool_path,
173184
'package_path': os.path.join(tool_path, "package.json"),

0 commit comments

Comments
 (0)