(command: string)
| 192 | } |
| 193 | |
| 194 | export function getCommandRoots(command: string): string[] { |
| 195 | if (!command) { |
| 196 | return []; |
| 197 | } |
| 198 | return splitCommands(command) |
| 199 | .map((c) => getCommandRoot(c)) |
| 200 | .filter((c): c is string => !!c); |
| 201 | } |
| 202 | |
| 203 | export function stripShellWrapper(command: string): string { |
| 204 | const pattern = /^\s*(?:sh|bash|zsh|cmd.exe)\s+(?:\/c|-c)\s+/; |
no test coverage detected