MCPcopy Create free account
hub / github.com/chhoumann/quickadd / parsePsOutput

Function parsePsOutput

scripts/stop-obsidian-e2e-instance.mjs:125–137  ·  view source on GitHub ↗
(stdout)

Source from the content-addressed store, hash-verified

123}
124
125export function parsePsOutput(stdout) {
126 const processes = [];
127 for (const line of stdout.split("\n")) {
128 const match = line.match(/^\s*(\d+)\s+(\d+)\s+(.*\S)\s*$/);
129 if (!match) continue;
130 processes.push({
131 pid: Number(match[1]),
132 ppid: Number(match[2]),
133 command: match[3],
134 });
135 }
136 return processes;
137}
138
139// Returns the pids of the Obsidian process tree bound to `instancePath`: the
140// seed processes whose argv references the instance profile, plus every

Callers 2

stopInstanceFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected