MCPcopy Index your code
hub / github.com/anomalyco/opencode / parseShellEnv

Function parseShellEnv

packages/desktop/src/main/shell-env.ts:25–34  ·  view source on GitHub ↗
(out: Buffer)

Source from the content-addressed store, hash-verified

23}
24
25export 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
36function probe(shell: string, mode: "-il" | "-l"): Probe {
37 const out = spawnSync(shell, [mode, "-c", "env -0"], {

Callers 2

shell-env.test.tsFile · 0.90
probeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected