If I use minimatch (or glob) with forward slashes in my pattern, everything works as expected. But if I use backslashes as path separators in my pattern, minimatch always returns false -- it never matches anything. This means I can't use path.join to build my pattern string (even though it's an obvious choice), because path.join uses backslashes on Windows.
minimatch should work correctly with patterns that use the current platform's path separator. (It'd be even better if it always accepted either kind of path separator, regardless of the current platform.)
mm = require('minimatch');
// Simple match. Returns true, as expected.
// Same match, but now using path.join.
// Expected: Should return true.
// Actual: returns false (on Windows).
path = require('path');
mm('foo/bar/baz', path.join('foo', '**', 'baz'))
// Equivalent to the previous example.
// Should return true, but instead returns false.
Fixing this would probably just be a matter of making minimatch normalize the test string to use forward slashes instead of backslashes.
Yeah, on Windows, it should probably just normalize slashes in the pattern in the Minimatch constructor, and the test string in Minimatch.prototype.match. Since glob just uses a Minimatch object, it probably doesn't require any changes.
Issue #7, backslash path-separators on Windows