From 0a5396414ee1c4ecffd6094e085d99e41ab1cf85 Mon Sep 17 00:00:00 2001 From: okunishinishi Date: Tue, 3 Nov 2015 21:51:12 +0900 Subject: [PATCH] Bugfix --- lib/watch_files.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/watch_files.js b/lib/watch_files.js index ee98e82..921bdbb 100644 --- a/lib/watch_files.js +++ b/lib/watch_files.js @@ -25,8 +25,11 @@ function watchFiles(filenames, options, handler) { filenames = args.shift('string|array'); options = args.pop('object') || {}; + var cwd = options.cwd || process.cwd(); filenames = expandglob.sync(filenames, { - cwd: options.cwd || process.cwd() + cwd: cwd + }).map(function(filename){ + return path.resolve(cwd, filename); }).filter(fs.existsSync); colorprint.info('[watchFiles] Start watch files...'); colorprint.trace('%s', filenames);