MCPcopy
hub / github.com/garrytan/gstack / buildTelemetrySpawnCommand

Function buildTelemetrySpawnCommand

browse/src/security.ts:459–470  ·  view source on GitHub ↗
(
  bin: string,
  args: string[],
  env: NodeJS.ProcessEnv = process.env,
)

Source from the content-addressed store, hash-verified

457 * env, bin, args) so we can assert on it without actually spawning.
458 */
459export function buildTelemetrySpawnCommand(
460 bin: string,
461 args: string[],
462 env: NodeJS.ProcessEnv = process.env,
463): { cmd: string; cmdArgs: string[] } | null {
464 if (process.platform === 'win32') {
465 const bashPath = resolveBashBinary(env);
466 if (!bashPath) return null;
467 return { cmd: bashPath, cmdArgs: [bin, ...args] };
468 }
469 return { cmd: bin, cmdArgs: args };
470}
471
472/**
473 * Fire-and-forget subprocess invocation of gstack-telemetry-log with the

Callers 2

security.test.tsFile · 0.90
reportAttemptTelemetryFunction · 0.85

Calls 1

resolveBashBinaryFunction · 0.85

Tested by

no test coverage detected