fix(config): scan active opencode profile plugins

This commit is contained in:
YeonGyu-Kim
2026-05-28 14:42:28 +09:00
parent 06c86f526a
commit a6c05e1823
2 changed files with 50 additions and 1 deletions
+8 -1
View File
@@ -23,6 +23,13 @@ function getConfigPaths(directory: string): string[] {
path.join(crossPlatformDir, "opencode", "opencode.jsonc"),
]
const customConfigDir = process.env.OPENCODE_CONFIG_DIR?.trim()
if (customConfigDir) {
const resolvedCustomConfigDir = path.resolve(customConfigDir)
paths.push(path.join(resolvedCustomConfigDir, "opencode.json"))
paths.push(path.join(resolvedCustomConfigDir, "opencode.jsonc"))
}
if (process.platform === "win32") {
const appdataDir = getWindowsAppdataDir()
if (appdataDir) {
@@ -31,7 +38,7 @@ function getConfigPaths(directory: string): string[] {
}
}
return paths
return Array.from(new Set(paths))
}
export function loadOpencodePlugins(directory: string): string[] {