Repository navigation
fix: treat Windows App Execution Aliases as executable - #2
dyk1454683243-sudo wants to merge 1 commit into
Conversation
WindowsApps aliases such as mspaint.exe raise EACCES from fs.stat, so isexe reports them as non-executable. After an isexe miss or EACCES/EPERM, treat Microsoft\WindowsApps paths as executable when fs.access succeeds. Co-authored-by: David <dyk1454683243-sudo@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4760762b48
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| await access(p, constants.F_OK) | ||
| return true |
There was a problem hiding this comment.
Preserve PATHEXT filtering in the alias fallback
On Windows, any existing path beneath a directory named Microsoft\WindowsApps is now accepted after isexe returns false, even when it rejected the path because its extension is absent from PATHEXT or because it is a directory. For example, which('notes.txt', { path: windowsAppsDir }) prepends the extensionless candidate because the command contains a dot; isexe correctly rejects .txt, but this F_OK check then returns it as executable. The synchronous helper has the same issue. Restrict the fallback to valid executable extensions and to the specific condition that identifies an app execution alias.
Useful? React with 👍 / 👎.
Upstream PR: npm#184
Fixes npm#157.
This branch is the same change as the upstream PR. Root-cause companion: isaacs/isexe#42