mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-05-24 23:10:39 +08:00
fix(skills): sync imported skills to app directories after import (#2101)
`import_from_apps()` saves skills to the database but does not create symlinks/copies in the target app directories (e.g. `~/.claude/skills/`). This causes skills to appear as "installed" in the UI while the actual files are missing from the app directories. Add `sync_to_app_dir()` calls after `db.save_skill()` in the import loop, matching the pattern used by `install()` and `toggle_app()`.
This commit is contained in:
@@ -1549,6 +1549,20 @@ impl SkillService {
|
||||
|
||||
// 保存到数据库
|
||||
db.save_skill(&skill)?;
|
||||
|
||||
// 同步到已启用的应用目录(创建 symlink 或复制文件)
|
||||
for app in AppType::all() {
|
||||
if skill.apps.is_enabled_for(&app) {
|
||||
if let Err(e) = Self::sync_to_app_dir(&skill.directory, &app) {
|
||||
log::warn!(
|
||||
"导入后同步 Skill '{}' 到 {:?} 失败: {e:#}",
|
||||
skill.directory,
|
||||
app
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
imported.push(skill);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user