From 6164d8699c0f07fd8fcbae88221eb35d99fb02e4 Mon Sep 17 00:00:00 2001 From: Parashuram Date: Sun, 6 Jul 2014 12:00:40 -0700 Subject: [PATCH] fix(watcher): handle paths on Windows --- lib/watcher.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/watcher.js b/lib/watcher.js index f5de7e99b..9c55f6782 100644 --- a/lib/watcher.js +++ b/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) {