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

nonull not working? #43

Closed
cowboy opened this issue May 6, 2012 · 5 comments
Closed

nonull not working? #43

cowboy opened this issue May 6, 2012 · 5 comments

Comments

@cowboy
Copy link

@cowboy cowboy commented May 6, 2012

If nonull was set, shouldn't the returned array always contain at least something? I'm using glob@3.1.9.

var glob = require('glob');

glob.sync('xyz', {nonull: true}); // []

glob('xyz', {nonull: true}, function(err, files) {
  console.log(err, files); // logs: null []
});
@cowboy
Copy link
Author

@cowboy cowboy commented Jun 4, 2012

Any thoughts on this issue?

@cowboy
Copy link
Author

@cowboy cowboy commented Jul 31, 2012

I'm still seeing this behavior in v3.1.11. What's the point of the nonull setting if it doesn't return the originally-specified pattern in the array when files aren't matched?

Per the readme:

nonull Set to never return an empty set, instead returning a set containing the pattern itself. This is the default in glob(3).

@benatkin
Copy link

@benatkin benatkin commented Aug 6, 2012

On this line: https://github.com/isaacs/node-glob/blob/master/glob.js#L181

s/nou/all/

If that's the only bug causing this behavior it ought to fix it.

@isaacs isaacs closed this in 1be0c30 Aug 6, 2012
@isaacs
Copy link
Owner

@isaacs isaacs commented Aug 6, 2012

Yep. That's the bug, alright. Thanks.

@cowboy
Copy link
Author

@cowboy cowboy commented Aug 6, 2012

Awesome.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.