Repository navigation
fix(which)!: preserve explicitly supplied executable paths - #1289
Open
sergioperezcheco wants to merge 2 commits into
Open
sergioperezcheco wants to merge 2 commits into
sergioperezcheco wants to merge 2 commits into
Conversation
Preserve lexical relative paths as requested in shelljs#658 and cover explicit paths without changing PATH lookup. Assisted-by: Hermes Agent Signed-off-by: sergioperezcheco <checo520@outlook.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1289 +/- ##
==========================================
+ Coverage 97.17% 97.30% +0.13%
==========================================
Files 36 36
Lines 1523 1523
==========================================
+ Hits 1480 1482 +2
+ Misses 43 41 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Assisted-by: Hermes Agent (gpt-6.1-sol) Signed-off-by: sergioperezcheco <checo520@outlook.com>
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.
When
which()is given an executable path containing/, preserve that path rather than converting it to an absolute path. This implements the behavior requested in #658, including-a, while leaving PATH lookup unchanged. Add explicit-path coverage and update the generated documentation.This intentionally changes the documented always-absolute behavior for explicit relative paths; #658 is labeled breaking, so this should be released with the appropriate breaking-change version rather than backported as a patch. Absolute paths and PATH search retain their existing behavior.
Validated on macOS with Node 22: the new regressions fail against the original implementation and pass with this change;
npm testincluding lint, coverage, Node-support checks, and independently exercised package/public API checks pass. Windows/Linux and the other supported Node versions were not run locally.Fixes #658.
AI-assisted implementation and automated independent review; no human review is claimed.