Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not infer cwd from pkgUp, if pkgUp walks all the way to / #180

Merged
merged 2 commits into from
Mar 12, 2016
Merged

Conversation

bcoe
Copy link
Member

@bcoe bcoe commented Mar 4, 2016

The library pkgUp is used to find the closest package.json, which nyc uses as cwd.

If pkgUp walks all the way to /, it returns the string package.json. In this edge-case, we should not switch to cwd to the path of the package.json found by pkgUp.

@jamestalmage
Copy link
Member

This almost seems like a pkgUp bug. Shouldn't it return null?

@novemberborn
Copy link
Contributor

This almost seems like a pkgUp bug. Shouldn't it return null?

It will. pkg-up --> find-up.

Any chance you have a /package.json on your machine @bcoe?

@bcoe
Copy link
Member Author

bcoe commented Mar 4, 2016

@novemberborn @jamestalmage I have no /package.json, and we were seeing the same behavior on Travis/Appveyor which was breaking tests.

I'm really confused because it feels like this should have always been broken, and pkg-up and find-up only have one release (and haven't changed in a while). This fixes things, but I'm trying to figure out which dependency of a dependency caused behavior to change ¯_(ツ)_/¯

@novemberborn
Copy link
Contributor

It's a bug in find-up, introduced by sindresorhus/find-up#3 and released 3 days ago. Once it runs out of path parts to try it accidentally uses the working directory and returns a relative path.

@novemberborn
Copy link
Contributor

This will be fixed with sindresorhus/find-up#4.

@sindresorhus
Copy link
Member

[email protected] is out with @novemberborn's fix. Sorry about the trouble.

bcoe added a commit that referenced this pull request Mar 12, 2016
do not infer cwd from pkgUp, if pkgUp walks all the way to /
@bcoe bcoe merged commit bb887b7 into master Mar 12, 2016
@bcoe bcoe deleted the fix-tests branch March 12, 2016 23:11
@novemberborn
Copy link
Contributor

@bcoe why merge this? find-up had a bug but that's resolved now.

@bcoe
Copy link
Member Author

bcoe commented Mar 13, 2016

@novemberborn I figured it was worth merging an explicit bump of find-up:

"find-up": "^1.1.2",

@novemberborn
Copy link
Contributor

@bcoe ah sorry, hadn't checked the diff 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants