* Finds a Python executable in the given directory.
(dir: string, candidates: string[])
| 89 | * Finds a Python executable in the given directory. |
| 90 | */ |
| 91 | async function findPythonInDirectory(dir: string, candidates: string[]): Promise<string | null> { |
| 92 | for (const candidate of candidates) { |
| 93 | const pythonPath = join(dir, candidate) |
| 94 | const pythonStat = await stat(pythonPath).catch(() => null) |
| 95 | if (pythonStat?.isFile()) { |
| 96 | return pythonPath |
| 97 | } |
| 98 | } |
| 99 | return null |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * Detects the default Python command available on the system. |
no outgoing calls
no test coverage detected