From 7a04e2c71f31ef0d508d3e3c7673ce9533f363da Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Thu, 28 Dec 2017 20:04:38 +0000 Subject: [PATCH] fix: incorrect count of watch files being reported The number of watched files was correct, but showed (incorrectly) a cumulative total of watched files (i.e. 1 + 2 + 3 + 4 etc). Fixes #1194 --- lib/monitor/watch.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/monitor/watch.js b/lib/monitor/watch.js index 67aba74f..4d2fd00f 100644 --- a/lib/monitor/watch.js +++ b/lib/monitor/watch.js @@ -108,13 +108,7 @@ function watch() { }); return Promise.all(promises).then(function (res) { - var total = res.reduce(function (acc, curr) { - acc += curr; - return acc; - }, 0); - - var count = total.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); - utils.log.detail('watching ' + count + ' files'); + utils.log.detail(`watching ${watchedFiles.length} file${watchedFiles.length === 1 ? '' : 's'}`); return watchedFiles; }); }