Compare commits
2 Commits
6ecb0d70e3
...
79206aafea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79206aafea | ||
|
|
89b7bb9928 |
@ -395,6 +395,14 @@ def _extract_skills_to_robot(bot_id: str, skills: List[str], project_path: Path)
|
||||
skills_target_dir.mkdir(parents=True, exist_ok=True)
|
||||
logger.info(f"Copying skills to {skills_target_dir}")
|
||||
|
||||
# 清理不在列表中的多余 skill 文件夹
|
||||
expected_skill_names = {os.path.basename(skill) for skill in skills}
|
||||
if skills_target_dir.exists():
|
||||
for item in skills_target_dir.iterdir():
|
||||
if item.is_dir() and item.name not in expected_skill_names:
|
||||
logger.info(f" Removing stale skill directory: {item}")
|
||||
shutil.rmtree(item)
|
||||
|
||||
for skill in skills:
|
||||
target_dir = skills_target_dir / os.path.basename(skill)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user