nonull not working? #43

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

Projects

None yet

3 participants

@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
cowboy commented Jun 4, 2012

Any thoughts on this issue?

@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
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
Owner
isaacs commented Aug 6, 2012

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

@cowboy
cowboy commented Aug 6, 2012

Awesome.

This was referenced Mar 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment