(command: string)
| 79 | * But not <<EOF (heredoc), << (bit shift), or <(process substitution) |
| 80 | */ |
| 81 | export function hasStdinRedirect(command: string): boolean { |
| 82 | // Look for < followed by whitespace and a filename/path |
| 83 | // Negative lookahead to exclude: <<, <( |
| 84 | // Must be preceded by whitespace or command separator or start of string |
| 85 | return /(?:^|[\s;&|])<(?![<(])\s*\S+/.test(command) |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * Checks if stdin redirect should be added to a command |
no outgoing calls
no test coverage detected