Skip to content

Commit

Permalink
Merge 75f4bd9 into bc38ab3
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier Garmón committed Sep 21, 2015
2 parents bc38ab3 + 75f4bd9 commit e386027
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ chokidar.watch('file', {
ignoreInitial: false,
followSymlinks: true,
cwd: '.',
preventPathTransformation: false,

usePolling: true,
alwaysStat: false,
Expand All @@ -108,6 +109,7 @@ chokidar.watch('file', {

ignorePermissionErrors: false,
atomic: true

});

```
Expand Down Expand Up @@ -140,6 +142,9 @@ symlinks themselves will be watched for changes instead of following
the link references and bubbling events through the link's path.
* `cwd` (no default). The base directory from which watch `paths` are to be
derived. Paths emitted with events will be relative to this.
* `preventPathTransformation` (default: `false`). When `true`, path is used literally
without any transformation. It's useful when the name contains special characters
like `*`, `(`, `)`, `{`, `}`...

#### Performance

Expand Down
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ function FSWatcher(_opts) {

if (undef('followSymlinks')) opts.followSymlinks = true;

// Prevent get non-magic path
if (undef('preventPathTransformation')) opts.preventPathTransformation = false;

this._isntIgnored = function(path, stat) {
return !this._isIgnored(path, stat);
}.bind(this);
Expand Down Expand Up @@ -239,7 +242,7 @@ FSWatcher.prototype._isIgnored = function(path, stats) {
// Returns object containing helpers for this path
FSWatcher.prototype._getWatchHelpers = function(path, depth) {
path = path.replace(/^\.[\/\\]/, '');
var watchPath = depth ? path : globparent(path);
var watchPath = depth || this.options.preventPathTransformation ? path : globparent(path);
var hasGlob = watchPath !== path;
var globFilter = hasGlob ? anymatch(path) : false;

Expand Down

0 comments on commit e386027

Please sign in to comment.