MCPcopy Index your code
hub / github.com/devcontainers/cli / findLocalWindowsExecutableWithExtension

Function findLocalWindowsExecutableWithExtension

src/spec-common/commonUtils.ts:493–504  ·  view source on GitHub ↗
(fullPath: string)

Source from the content-addressed store, hash-verified

491const executableExtensions = pathext ? pathext.toLowerCase().split(';') : ['.com', '.exe', '.bat', '.cmd'];
492
493async 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
506export function parseVersion(str: string) {
507 const m = /^'?v?(\d+(\.\d+)*)/.exec(str);

Callers 1

Calls 1

isLocalFileFunction · 0.90

Tested by

no test coverage detected