(fullPath: string)
| 491 | const executableExtensions = pathext ? pathext.toLowerCase().split(';') : ['.com', '.exe', '.bat', '.cmd']; |
| 492 | |
| 493 | async function findLocalWindowsExecutableWithExtension(fullPath: string) { |
| 494 | if (executableExtensions.indexOf(path.extname(fullPath)) !== -1) { |
| 495 | return await isLocalFile(fullPath) ? fullPath : undefined; |
| 496 | } |
| 497 | for (const ext of executableExtensions) { |
| 498 | const withExtension = fullPath + ext; |
| 499 | if (await isLocalFile(withExtension)) { |
| 500 | return withExtension; |
| 501 | } |
| 502 | } |
| 503 | return undefined; |
| 504 | } |
| 505 | |
| 506 | export function parseVersion(str: string) { |
| 507 | const m = /^'?v?(\d+(\.\d+)*)/.exec(str); |
no test coverage detected