(command, instancePath)
| 106 | } |
| 107 | |
| 108 | export function commandMatchesInstance(command, instancePath) { |
| 109 | const stripped = stripPrivatePrefix(instancePath); |
| 110 | const variants = new Set([ |
| 111 | instancePath, |
| 112 | stripped, |
| 113 | stripped.replace(/^\//, "/private/"), |
| 114 | ]); |
| 115 | // Seed only on the Obsidian `--user-data-dir=` flag whose value is THIS |
| 116 | // instance's profile dir (with a trailing separator). Scoping to the flag, not |
| 117 | // a bare substring, means an unrelated process that merely mentions the path — |
| 118 | // a log tail, an editor, a grep — is never pulled into the kill set. The |
| 119 | // trailing slash stops a sibling whose id shares this one as a leading string. |
| 120 | return [...variants].some((variant) => |
| 121 | command.includes(`--user-data-dir=${variant}/`), |
| 122 | ); |
| 123 | } |
| 124 | |
| 125 | export function parsePsOutput(stdout) { |
| 126 | const processes = []; |
no test coverage detected