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

v9 not throwing ENOTDIR when cwd is a file #105

Closed
chrisblossom opened this issue Jan 15, 2019 · 5 comments
Closed

v9 not throwing ENOTDIR when cwd is a file #105

chrisblossom opened this issue Jan 15, 2019 · 5 comments
Labels
bug 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt help wanted

Comments

@chrisblossom
Copy link
Contributor

chrisblossom commented Jan 15, 2019

Issuehunt badges

This might be expected, but when using '.' as the pattern and specifying cwd as a file, an error is no longer thrown in v9 like it was in v8.

passing: chrisblossom/globby/v8-is-file/test.js#L199-L221
failing: chrisblossom/globby/v9-is-file/test.js#L218-L241

medusalix earned $20.00 by resolving this issue!

@sindresorhus
Copy link
Owner

Would you be able to submit those tests as failing tests? That would help getting this fixed faster.

chrisblossom added a commit to chrisblossom/globby that referenced this issue Feb 15, 2019
chrisblossom added a commit to chrisblossom/globby that referenced this issue Feb 15, 2019
sindresorhus pushed a commit that referenced this issue Feb 16, 2019
@IssueHuntBot
Copy link

@IssueHunt has funded $20.00 to this issue. See it on IssueHunt

@medusalix
Copy link
Contributor

medusalix commented Feb 19, 2019

This is caused by an update to dir-glob version 2.2.1. The commit Add cwd option added the cwd option to dir-glob, which changed the way it treats the filepath passed to it:

2.0.0

const getPath = filepath => filepath[0] === '!' ? filepath.slice(1) : filepath;

2.2.1

const getPath = (filepath, cwd) => path.join(cwd, filepath[0] === '!' ? filepath.slice(1) : filepath);

@sindresorhus What should we do? Remove the failing tests?

@sindresorhus
Copy link
Owner

What should we do?

Add a check to ensure cwd is a directory.

@IssueHuntBot
Copy link

@sindresorhus has rewarded $18.00 to @medusalix. See it on IssueHunt

  • 💰 Total deposit: $20.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $2.00

@issuehunt-oss issuehunt-oss bot added the 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt label May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt help wanted
Projects
None yet
Development

No branches or pull requests

4 participants