From b597c27d40ac34fa2900d2dfcde1c7e0220b7441 Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Mon, 30 Apr 2018 16:27:10 +0100 Subject: [PATCH] test: fix weird output on restart filename --- lib/monitor/watch.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/monitor/watch.js b/lib/monitor/watch.js index 2b16f3e..99f0b66 100644 --- a/lib/monitor/watch.js +++ b/lib/monitor/watch.js @@ -134,18 +134,23 @@ function filterAndRestart(files) { files = [files]; } if (files.length) { - var cwd = this.options ? this.options.cwd : process.cwd(); + var cwd = process.cwd(); + if (this.options && this.options.cwd) { + cwd = this.options.cwd; + } + utils.log.detail( 'files triggering change check: ' + files .map(function (file) { - return path.relative(cwd, file); + const res = path.relative(cwd, file); + return res; }) .join(', ') ); files = files.map(file => { - return path.relative(process.cwd(), path.join(cwd, file)); + return path.relative(process.cwd(), path.relative(cwd, file)); }); if (utils.isWindows) {