shama / gaze

:crystal_ball: A globbing fs.watch wrapper built from the best parts of other fine watch libs.
MIT License
1.15k stars 168 forks source link

_addToWatched() add dir without path.sep #217

Closed wyicwx closed 8 years ago

wyicwx commented 8 years ago
// Adds files and dirs to watched
Gaze.prototype._addToWatched = function(files) {
  for (var i = 0; i < files.length; i++) {
    var file = files[i];
    var filepath = path.resolve(this.options.cwd, file);

    // If a new dir is added
    if (helper.isDir(file) && !(dirname in this._watched)) {
      helper.objectPush(this._watched, dirname, []);
    }
   //....
  }
}

path.resolve return the path without end with path.sep