MCPcopy Index your code
hub / github.com/devcontainers/cli / buildProcessTrees

Function buildProcessTrees

src/spec-common/proc.ts:58–64  ·  view source on GitHub ↗
(processes: Process[])

Source from the content-addressed store, hash-verified

56}
57
58export function buildProcessTrees(processes: Process[]) {
59 const index: Record<string, ProcessTree> = {};
60 processes.forEach(process => index[process.pid] = { process, childProcesses: [] });
61 processes.filter(p => p.ppid)
62 .forEach(p => index[p.ppid!]?.childProcesses.push(index[p.pid]));
63 return index;
64}
65
66export function processTreeToString(tree: ProcessTree, singleIndent = ' ', currentIndent = ' '): string {
67 return `${currentIndent}${tree.process.pid}: ${tree.process.cmd}

Callers 1

runUserEnvProbeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected