async.js
async.js copied to clipboard
Broken behaviour in glob()
glob finds files that should not match my pattern. Interesting enough, this happens only on the first level.
xy:/tmp/foo$ ls -R .
.:
test test.js
./test:
dir1 file1.foo file2.foo file5.bar
./test/dir1:
file3.foo file4.bar
xy:/tmp/foo$ cat test.js
var sys = require('sys'),
async = require('asyncjs');
async.glob(__dirname + '/test/*/*.foo').toArray(function(err, files) {
sys.puts(sys.inspect(files));
});
xy:/tmp/foo$ node test.js
[ { path: '/tmp/foo/test/file1.foo', name: 'file1.foo' }
, { path: '/tmp/foo/test/file5.bar', name: 'file5.bar' }
, { path: '/tmp/foo/test/file2.foo', name: 'file2.foo' }
, { path: '/tmp/foo/test/dir1/file3.foo'
, name: 'file3.foo'
, stat: { ... }
}
]
You might think about just using https://github.com/isaacs/node-glob/
Stange. Thanks for the bug report