MCPcopy Index your code
hub / github.com/codeaashu/claude-code / formatShellPrefixCommand

Function formatShellPrefixCommand

src/utils/bash/shellPrefix.ts:15–28  ·  view source on GitHub ↗
(
  prefix: string,
  command: string,
)

Source from the content-addressed store, hash-verified

13 * @returns The properly formatted command string with quoted components
14 */
15export function formatShellPrefixCommand(
16 prefix: string,
17 command: string,
18): string {
19 // Split on the last space before a dash to separate executable from arguments
20 const spaceBeforeDash = prefix.lastIndexOf(' -')
21 if (spaceBeforeDash > 0) {
22 const execPath = prefix.substring(0, spaceBeforeDash)
23 const args = prefix.substring(spaceBeforeDash + 1)
24 return `${quote([execPath])} ${args} ${quote([command])}`
25 } else {
26 return `${quote([prefix])} ${quote([command])}`
27 }
28}
29

Callers 2

execCommandHookFunction · 0.85
buildExecCommandFunction · 0.85

Calls 1

quoteFunction · 0.85

Tested by

no test coverage detected