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

Function containsControlStructure

src/utils/bash/bashPipeCommand.ts:247–249  ·  view source on GitHub ↗

* Checks if a command contains bash control structures that shell-quote cannot parse. * These include for/while/until/if/case/select loops and conditionals. * We match keywords followed by whitespace to avoid false positives with commands * or arguments that happen to contain these words.

(command: string)

Source from the content-addressed store, hash-verified

245 * or arguments that happen to contain these words.
246 */
247function containsControlStructure(command: string): boolean {
248 return /\b(for|while|until|if|case|select)\s/.test(command)
249}
250
251/**
252 * Quotes a command and adds `< /dev/null` as a shell redirect on eval, rather than

Callers 1

rearrangePipeCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected