MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / resolveViewerDir

Function resolveViewerDir

src/ui-server/assets.ts:62–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60 * @throws {ViewerMissingError} when no candidate contains an `index.html`.
61 */
62export function resolveViewerDir(): string {
63 const candidates = viewerDirCandidates();
64 for (const dir of candidates) {
65 try {
66 if (fs.statSync(path.join(dir, 'index.html')).isFile()) {
67 // realpath so the containment checks in `security.ts` compare like for
68 // like when the install lives behind a symlink (Homebrew, nvm, pnpm).
69 return fs.realpathSync(dir);
70 }
71 } catch {
72 // Not here — try the next candidate.
73 }
74 }
75 throw new ViewerMissingError(candidates);
76}

Callers 1

startUiServerFunction · 0.90

Calls 2

viewerDirCandidatesFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected