MCPcopy Create free account
hub / github.com/anomalyco/opencode / discoverThemes

Function discoverThemes

packages/tui/src/context/theme.tsx:52–61  ·  view source on GitHub ↗
(directories: string[])

Source from the content-addressed store, hash-verified

50}
51
52export async function discoverThemes(directories: string[]) {
53 const result: Record<string, unknown> = {}
54 for (const directory of directories) {
55 const files = await Glob.scan("themes/*.json", { cwd: directory, absolute: true, dot: true, symlink: true })
56 for (const file of files) {
57 result[path.basename(file, ".json")] = JSON.parse(await readFile(file, "utf8")) as unknown
58 }
59 }
60 return result
61}
62
63export {
64 DEFAULT_THEMES,

Callers 2

theme.test.tsFile · 0.90
discoverFunction · 0.85

Calls 1

readFileFunction · 0.85

Tested by

no test coverage detected