* 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)
| 245 | * or arguments that happen to contain these words. |
| 246 | */ |
| 247 | function 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 |
no outgoing calls
no test coverage detected