MCPcopy Create free account
hub / github.com/backnotprop/plannotator / buildCliSpawnConfig

Function buildCliSpawnConfig

apps/opencode-plugin/cli-bridge.ts:137–152  ·  view source on GitHub ↗
(
  bin: string,
  args: string[],
  platform: NodeJS.Platform = process.platform,
  env: NodeJS.ProcessEnv = process.env,
)

Source from the content-addressed store, hash-verified

135}
136
137export function buildCliSpawnConfig(
138 bin: string,
139 args: string[],
140 platform: NodeJS.Platform = process.platform,
141 env: NodeJS.ProcessEnv = process.env,
142): CliSpawnConfig {
143 if (platform === "win32" && !path.isAbsolute(bin)) {
144 return {
145 command: resolveWindowsCliCommand(bin, env) || bin,
146 args,
147 shell: false,
148 };
149 }
150
151 return { command: bin, args, shell: false };
152}
153
154function parseLastJson<T>(stdout: string): T {
155 const lines = stdout.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);

Callers 2

cli-bridge.test.tsFile · 0.90
runPlannotatorCliFunction · 0.85

Calls 1

resolveWindowsCliCommandFunction · 0.85

Tested by

no test coverage detected