(startDir: string)
| 151 | } |
| 152 | |
| 153 | function findOpencodeDir(startDir: string): string | null { |
| 154 | let current = startDir |
| 155 | while (current !== "/") { |
| 156 | const candidate = join(current, ".opencode") |
| 157 | if (existsSync(candidate)) { |
| 158 | try { |
| 159 | if (statSync(candidate).isDirectory()) { |
| 160 | return candidate |
| 161 | } |
| 162 | } catch { |
| 163 | // ignore inaccessible entries while walking upward |
| 164 | } |
| 165 | } |
| 166 | const parent = dirname(current) |
| 167 | if (parent === current) { |
| 168 | break |
| 169 | } |
| 170 | current = parent |
| 171 | } |
| 172 | return null |
| 173 | } |
| 174 | |
| 175 | function resolvePromptPaths(workingDirectory: string): PromptPaths { |
| 176 | const configHome = process.env.XDG_CONFIG_HOME || join(homedir(), ".config") |
no outgoing calls
no test coverage detected