MCPcopy Create free account
hub / github.com/pingdotgg/t3code / sanitizeShellModeArgsForPlatform

Function sanitizeShellModeArgsForPlatform

packages/shared/src/shell.ts:77–82  ·  view source on GitHub ↗

* Escapes arguments for shell-mode spawns: applies escapeWindowsShellArg * when the platform is `win32` (where `shell: true` routes through `cmd.exe`) * and returns the arguments untouched everywhere else.

(
  args: ReadonlyArray<string>,
  platform: NodeJS.Platform,
)

Source from the content-addressed store, hash-verified

75 * and returns the arguments untouched everywhere else.
76 */
77function sanitizeShellModeArgsForPlatform(
78 args: ReadonlyArray<string>,
79 platform: NodeJS.Platform,
80): Array<string> {
81 return platform === "win32" ? args.map(escapeWindowsShellArg) : [...args];
82}
83
84export interface ResolvedSpawnCommand {
85 readonly command: string;

Callers 1

shell.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected