Skip to content

Commit

Permalink
fix(watcher): handle paths on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Parashuram committed Jul 6, 2014
1 parent a50ebdd commit 6164d86
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ var DIR_SEP = require('path').sep;

// Get parent folder, that be watched (does not contain any special globbing character)
var baseDirFromPattern = function(pattern) {
return pattern.replace(/\/[^\/]*\*.*$/, '') // remove parts with *
.replace(/\/[^\/]*[\!\+]\(.*$/, '') // remove parts with !(...) and +(...)
.replace(/\/[^\/]*\)\?.*$/, '') || '/'; // remove parts with (...)?
return pattern.replace(/[\/\\][^\/\\]*\*.*$/, '') // remove parts with *
.replace(/[\/\\][^\/\\]*[\!\+]\(.*$/, '') // remove parts with !(...) and +(...)
.replace(/[\/\\][^\/\\]*\)\?.*$/, '') || DIR_SEP; // remove parts with (...)?
};

var watchPatterns = function(patterns, watcher) {
Expand Down

0 comments on commit 6164d86

Please sign in to comment.