fix(skill-loader): discover skills from parent config dir when using profiles
OPENCODE_CONFIG_DIR pointing to profiles/ subdirectory caused skills at ~/.config/opencode/skills/ to be invisible. Added getOpenCodeSkillDirs() with the same parent-dir fallback that getOpenCodeCommandDirs() uses.
This commit is contained in:
@@ -22,3 +22,15 @@ export function getOpenCodeCommandDirs(options: OpenCodeConfigDirOptions): strin
|
||||
])
|
||||
)
|
||||
}
|
||||
|
||||
export function getOpenCodeSkillDirs(options: OpenCodeConfigDirOptions): string[] {
|
||||
const configDir = getOpenCodeConfigDir(options)
|
||||
const parentConfigDir = getParentOpencodeConfigDir(configDir)
|
||||
|
||||
return Array.from(
|
||||
new Set([
|
||||
join(configDir, "skills"),
|
||||
...(parentConfigDir ? [join(parentConfigDir, "skills")] : []),
|
||||
])
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user