mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
allow reading of opencode.json(c) from .opencode/
This commit is contained in:
parent
b2dd9fdfdf
commit
8cef7940fe
2 changed files with 13 additions and 0 deletions
|
|
@ -35,6 +35,19 @@ export namespace Config {
|
|||
}
|
||||
}
|
||||
|
||||
const opencodeDirectories = await Array.fromAsync(
|
||||
Filesystem.up({
|
||||
targets: [".opencode"],
|
||||
start: Instance.directory,
|
||||
stop: Instance.worktree,
|
||||
}),
|
||||
)
|
||||
for (const dir of opencodeDirectories.toReversed()) {
|
||||
for (const file of ["opencode.jsonc", "opencode.json"]) {
|
||||
result = mergeDeep(result, await loadFile(path.join(dir, file)))
|
||||
}
|
||||
}
|
||||
|
||||
// Override with custom config if provided
|
||||
if (Flag.OPENCODE_CONFIG) {
|
||||
result = mergeDeep(result, await loadFile(Flag.OPENCODE_CONFIG))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue