(out: Buffer)
| 23 | } |
| 24 | |
| 25 | export function parseShellEnv(out: Buffer) { |
| 26 | const env: Record<string, string> = {} |
| 27 | for (const line of out.toString("utf8").split("\0")) { |
| 28 | if (!line) continue |
| 29 | const ix = line.indexOf("=") |
| 30 | if (ix <= 0) continue |
| 31 | env[line.slice(0, ix)] = line.slice(ix + 1) |
| 32 | } |
| 33 | return env |
| 34 | } |
| 35 | |
| 36 | function probe(shell: string, mode: "-il" | "-l"): Probe { |
| 37 | const out = spawnSync(shell, [mode, "-c", "env -0"], { |
no outgoing calls
no test coverage detected