Skip to content
Permalink
Browse files

fix(watcher): handle paths on Windows

  • Loading branch information...
Parashuram
Parashuram committed Jul 6, 2014
1 parent a50ebdd commit 6164d8699c0f07fd8fcbae88221eb35d99fb02e4
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/watcher.js
@@ -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) {

0 comments on commit 6164d86

Please sign in to comment.
You can’t perform that action at this time.