(platform: NodeJS.Platform)
| 30 | } |
| 31 | |
| 32 | function getPythonCandidates(platform: NodeJS.Platform): PythonCandidate[] { |
| 33 | if (platform === 'win32') { |
| 34 | return [ |
| 35 | { |
| 36 | command: 'python3', |
| 37 | prefixArgs: [], |
| 38 | locator: { command: 'where', args: ['python3'] }, |
| 39 | }, |
| 40 | { |
| 41 | command: 'python', |
| 42 | prefixArgs: [], |
| 43 | locator: { command: 'where', args: ['python'] }, |
| 44 | }, |
| 45 | { |
| 46 | command: 'py', |
| 47 | prefixArgs: ['-3'], |
| 48 | locator: { command: 'where', args: ['py'] }, |
| 49 | }, |
| 50 | { |
| 51 | command: 'py', |
| 52 | prefixArgs: [], |
| 53 | locator: { command: 'where', args: ['py'] }, |
| 54 | }, |
| 55 | ] |
| 56 | } |
| 57 | |
| 58 | return [ |
| 59 | { |
| 60 | command: 'python3', |
| 61 | prefixArgs: [], |
| 62 | locator: { command: 'which', args: ['python3'] }, |
| 63 | }, |
| 64 | ] |
| 65 | } |
| 66 | |
| 67 | function extractPythonVersion(output: string): string | null { |
| 68 | const match = output.match(/Python\s+([0-9][^\s]*)/i) |
no outgoing calls
no test coverage detected