(stdout)
| 123 | } |
| 124 | |
| 125 | export 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 |
no test coverage detected