Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

fix(node-path): conform to NPM behavior when dealing with paths that include path.delimiter #208

Open
wants to merge 1 commit into
base: latest
Choose a base branch
from

Conversation

Xunnamius
Copy link

@Xunnamius Xunnamius commented Sep 16, 2018

Ref: #207

This makes NPX gracefully handle path.delimiter in a directory name similar to NPM in that they both "just work".

I tried to make this PR "immediately" mergeable. Specifically, the new code at line 42 keeps the old NPX behavior unless path.delimiter is found in npm bin. Otherwise, this PR would be blocked until accompanying changes in this node-which PR are (maybe) accepted. Further, the change on line 183 does not conflict with the current node-which module's behavior as it already accepts an opts object as a second argument. So, even without the accompanying PR from node-which present, NPX maintains its current behavior.

It might also be possible to get this working without a node-which PR by using opts.path, though, after looking over the node-which source, I didn't want to chance any side effects on Windows.

There is a slight reduction in % Branch and % Line coverage in the tests, though functionality has not changed. If that's a problem, I can write an extra test to cover the new conditional path, but I'd need some help since I'm not at all familiar with writing tap tests :)

Let me know if there's anything I can do/missed, or if node-which's opts.path would be a better solution. Thanks for this awesome software!

EDIT: looks like the Travis tests are failing for some reason external to this PR...

@Xunnamius Xunnamius changed the title fix(node-path): conform to npm behavior when dealing with paths that include path.delimiter fix(node-path): conform to NPM behavior when dealing with paths that include path.delimiter Sep 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant