From 5ce08f91b914697fcd6f5e536a793f42ea484bdb Mon Sep 17 00:00:00 2001 From: Jeroen Engels Date: Wed, 1 May 2024 00:08:17 +0200 Subject: [PATCH] Don't only watch on the first file request --- lib/watch.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/watch.js b/lib/watch.js index e77b233d1..5507653b6 100644 --- a/lib/watch.js +++ b/lib/watch.js @@ -85,7 +85,7 @@ function watchFiles( elmJsonWatcher.close(), readmeWatcher.close(), fileWatcher.close(), - extraFilesWatcher.close(), + extraFilesWatchers.forEach(watcher => watcher.close()), suppressedErrorsWatcher.close(), configurationWatcher && configurationWatcher.close() ]); @@ -128,13 +128,13 @@ function watchFiles( sourceDirectories ); - const extraFilesWatcher = createExtraFilesWatcher( + const extraFilesWatchers = requestedExtraFiles.map(request => createExtraFilesWatcher( options, app, runReview, onError, - requestedExtraFiles - ); + request + )); const suppressedErrorsWatcher = createSuppressedFilesWatcher( options, @@ -154,7 +154,7 @@ function watchFiles( elmJsonWatcher.close(), readmeWatcher.close(), fileWatcher.close(), - extraFilesWatcher.close(), + extraFilesWatchers.forEach((watcher) => watcher.close()), suppressedErrorsWatcher.close() ]); @@ -376,7 +376,7 @@ function createFileWatcher( * @param {App} app * @param {() => void} runReview * @param {(err: Error) => void} onError - * @param {ExtraFileRequest[]} extraFileRequests + * @param {ExtraFileRequest} request * @return {FSWatcher} */ function createExtraFilesWatcher( @@ -384,9 +384,8 @@ function createExtraFilesWatcher( app, runReview, onError, - extraFileRequests + request ) { - const request = extraFileRequests[0]; return chokidar .watch( request.files.map(