MCPcopy Index your code
hub / github.com/Opencode-DCP/opencode-dynamic-context-pruning / findOpencodeDir

Function findOpencodeDir

lib/config.ts:712–726  ·  view source on GitHub ↗
(startDir: string)

Source from the content-addressed store, hash-verified

710const GLOBAL_CONFIG_PATH_JSON = join(GLOBAL_CONFIG_DIR, "dcp.json")
711
712function findOpencodeDir(startDir: string): string | null {
713 let current = startDir
714 while (current !== "/") {
715 const candidate = join(current, ".opencode")
716 if (existsSync(candidate) && statSync(candidate).isDirectory()) {
717 return candidate
718 }
719 const parent = dirname(current)
720 if (parent === current) {
721 break
722 }
723 current = parent
724 }
725 return null
726}
727
728function getConfigPaths(ctx?: PluginInput): {
729 global: string | null

Callers 1

getConfigPathsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected