Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Windows, a lowercase
PATHEXTentry is expanded twice:.cmdbecomes['.cmd', '.cmd']. With an extensionless command andall: true, both the asynchronous and synchronous APIs therefore return the same executable path twice and repeat its executable check.Append the lowercase alternative only when it differs from the original extension. Keep the original-first ordering and distinct case alternatives required for case-sensitive Windows directories (#57, #100).
Tests cover the duplicate result using a real fixture through the existing Windows platform harness, plus distinct uppercase/lowercase matches and their order using a case-sensitive executable-check mock. The duplicate-result regression fails for both APIs on the original source and passes with this change.
Validation: both test files pass on Node 22.23.5 and 26.8.1, with 100% statement, branch, function, and line coverage. ESLint and
git diff --checkpass. Windows behavior was tested using platform isolation on macOS; no native Windows run was performed locally.npm testexits 1 only inpostlint/template-oss-check, which asks for updates to five generated.githubfiles. The template-check output is identical on untouched main (2009c9d) and this branch. Generated files are unchanged, as requested by CONTRIBUTING.md.The change is confined to constructing Windows extension candidates. Existing distinct candidates and their order remain intact; the commit can be reverted independently without a migration.
AI assistance: OpenAI Codex discovered, prepared, tested, and independently reviewed this patch under the account owner's authorization. The account owner has not personally reviewed or tested it.