MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / buildNpxCommand

Function buildNpxCommand

packages/cli/src/utils/npxCommand.ts:6–17  ·  view source on GitHub ↗
(
  args: readonly string[],
  platform: NodeJS.Platform = process.platform,
)

Source from the content-addressed store, hash-verified

4};
5
6export function buildNpxCommand(
7 args: readonly string[],
8 platform: NodeJS.Platform = process.platform,
9): NpxCommand {
10 if (platform === "win32") {
11 // npm installs npx as a .cmd shim on Windows; invoke it through cmd.exe
12 // instead of relying on child_process to resolve or execute the shim.
13 return { command: "cmd.exe", args: ["/d", "/s", "/c", "npx.cmd", ...args] };
14 }
15
16 return { command: "npx", args: [...args] };
17}

Callers 4

npxCommand.test.tsFile · 0.85
hasNpxFunction · 0.85
spawnNpxFunction · 0.85
runLocalStudioModeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected