(command: string)
| 24 | } |
| 25 | |
| 26 | function getExecutableFromShellCommand(command: string): string | null { |
| 27 | const trimmed = command.trim(); |
| 28 | if (!trimmed) return null; |
| 29 | |
| 30 | const quote = trimmed[0]; |
| 31 | if (quote === '"' || quote === "'") { |
| 32 | const endQuoteIndex = trimmed.indexOf(quote, 1); |
| 33 | if (endQuoteIndex === -1) { |
| 34 | return null; |
| 35 | } |
| 36 | return trimmed.slice(1, endQuoteIndex); |
| 37 | } |
| 38 | |
| 39 | return trimmed.split(/\s+/)[0] ?? null; |
| 40 | } |
| 41 | |
| 42 | function looksLikePath(command: string): boolean { |
| 43 | return ( |