MCPcopy Create free account
hub / github.com/apache/maka / buildShellSpawnPlan

Function buildShellSpawnPlan

packages/runtime/src/shell-detect.ts:140–155  ·  view source on GitHub ↗
(
  shell: ShellPlan,
  command: string,
  env: NodeJS.ProcessEnv = process.env,
)

Source from the content-addressed store, hash-verified

138}
139
140export function buildShellSpawnPlan(
141 shell: ShellPlan,
142 command: string,
143 env: NodeJS.ProcessEnv = process.env,
144): ShellSpawnPlan {
145 if ((shell.kind === 'pwsh' || shell.kind === 'powershell') && shell.exe) {
146 const wrapped = buildPowerShellCommand(command, env);
147 return {
148 file: shell.exe,
149 args: ['-NoLogo', '-NoProfile', '-NonInteractive', '-Command', wrapped.script],
150 useShellOption: false,
151 env: wrapped.env,
152 };
153 }
154 return { file: command, args: [], useShellOption: true };
155}
156
157export function buildPtyShellSpawnPlan(
158 shell: ShellPlan,

Callers 3

startPipeMethod · 0.85
runShellWithBoundedTailFunction · 0.85

Calls 1

buildPowerShellCommandFunction · 0.85

Tested by

no test coverage detected