-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
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:
[ '*.js' ]
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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels