Maybe I'm misunderstanding the readme, but when I do:
globule.match(["*.js"], ["/foo/bar/baz.js"], { srcBase: "/foo/bar" });
I'm expecting to get back ["/foo/bar/baz.js"], but I get []. If I add matchBase: true, I get that, but then nested directories also get included, which I don't want.
My real use case is this:
var match = function(dir, patterns, files) {
return globule.match(patterns, files, { srcBase: dir, matchBase: true });
};
where files is:
[ '/Users/AndrewNichols/code/anichols/manta/file-manifest/test/fixtures/bar.js',
'/Users/AndrewNichols/code/anichols/manta/file-manifest/test/fixtures/foo.js',
'/Users/AndrewNichols/code/anichols/manta/file-manifest/test/fixtures/baz/quux.js' ]
and patterns is:
and dir is: '/Users/AndrewNichols/code/anichols/manta/file-manifest/test/fixtures'.
With matchBase, I get all 3 files back (expected), but if I take it off, I get none. How do I actually get all files matching *.js but not **/*.js in the srcBase?
Maybe I'm misunderstanding the readme, but when I do:
I'm expecting to get back
["/foo/bar/baz.js"], but I get[]. If I addmatchBase: true, I get that, but then nested directories also get included, which I don't want.My real use case is this:
where
filesis:and
patternsis:and
diris:'/Users/AndrewNichols/code/anichols/manta/file-manifest/test/fixtures'.With
matchBase, I get all 3 files back (expected), but if I take it off, I get none. How do I actually get all files matching*.jsbut not**/*.jsin the srcBase?