MCPcopy Create free account
hub / github.com/Wirasm/kild / loadProjects

Function loadProjects

engine/src/kild/projects.ts:16–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14}
15
16/**
17 * Registered projects, or `[]`.
18 *
19 * This must never return a non-array. It used to hand back `parsed.projects` unchecked, so a
20 * `projects.json` that was hand-edited into a bare array — or anything else without that key
21 * — yielded `undefined`, and every caller does `.map`/`.find` on the result. One malformed
22 * file 500'd routes across the whole engine, blaming the server for the operator's typo.
23 */
24export async function loadProjects(): Promise<Project[]> {
25 let raw: string;
26 try {
27 raw = await fs.readFile(projectsFile(), 'utf8');

Callers 6

projectFunction · 0.90
server.tsFile · 0.90
kildToolsFunction · 0.90
findProjectFunction · 0.85
removeProjectFunction · 0.85
addProjectFunction · 0.85

Calls 1

projectsFileFunction · 0.85

Tested by

no test coverage detected