Skip to content

Commit

Permalink
Merge pull request #669 from remy/master
Browse files Browse the repository at this point in the history
Fix windows ignore when using anymatch@2 & cwd option
  • Loading branch information
es128 committed Jan 18, 2018
2 parents 3409db8 + 966c300 commit d26c6e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions index.js
Expand Up @@ -9,7 +9,8 @@ var isGlob = require('is-glob');
var isAbsolute = require('path-is-absolute');
var inherits = require('inherits');
var braces = require('braces');
var normalizePath = require('normalize-path')
var normalizePath = require('normalize-path');
var upath = require('upath');

var NodeFsHandler = require('./lib/nodefs-handler');
var FsEventsHandler = require('./lib/fsevents-handler');
Expand Down Expand Up @@ -357,7 +358,7 @@ FSWatcher.prototype._isIgnored = function(path, stats) {
if (cwd && ignored) {
ignored = ignored.map(function (path) {
if (typeof path !== 'string') return path;
return isAbsolute(path) ? path : sysPath.join(cwd, path);
return upath.normalize(isAbsolute(path) ? path : sysPath.join(cwd, path));
});
}
var paths = arrify(ignored)
Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -38,8 +38,7 @@
"mocha": "^3.0.0",
"rimraf": "^2.4.3",
"sinon": "^1.10.3",
"sinon-chai": "^2.6.0",
"upath": "1.0.0"
"sinon-chai": "^2.6.0"
},
"optionalDependencies": {
"fsevents": "^1.0.0"
Expand All @@ -54,6 +53,7 @@
"is-glob": "^4.0.0",
"normalize-path": "^2.1.1",
"path-is-absolute": "^1.0.0",
"readdirp": "^2.0.0"
"readdirp": "^2.0.0",
"upath": "1.0.0"
}
}

0 comments on commit d26c6e0

Please sign in to comment.