Skip to content

Commit

Permalink
Remove Windows edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Sep 1, 2024
1 parent 2d6e08f commit 7e5c963
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions source/windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,14 @@ const mIsExe = async (file, cwd, PATH) => {
.flatMap(extension =>
[cwd, ...parts].map(part => `${path.resolve(part, file)}${extension}`))
.map(async possibleFile => {
let fileStat;
try {
fileStat = await stat(possibleFile);
} catch {}

if (fileStat?.isFile()) {
// eslint-disable-next-line no-throw-literal
throw 0;
await stat(possibleFile);
} catch {
return;
}

// eslint-disable-next-line no-throw-literal
throw 0;
}));
} catch {
return true;
Expand Down

0 comments on commit 7e5c963

Please sign in to comment.