From 89a7bc09ecfcfe43537dde26201349647284a8a9 Mon Sep 17 00:00:00 2001 From: Keith Thompson Date: Mon, 30 Nov 2020 18:21:02 +0000 Subject: [PATCH] only add directory once --- dist/index.js | 6 +++--- index.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index facf8cb..a91707d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -71,9 +71,9 @@ function parseDirectories(file, depth, targetDirectory) { } function buildMatrix(changedDirectories) { - include = []; - var directory; - for (directory of changedDirectories) { + let directories = [...new Set(changedDirectories)]; + let include = [] + for (directory of directories) { include.push({'directory': directory}); } return {'include': include}; diff --git a/index.js b/index.js index 9f04890..27ba10a 100644 --- a/index.js +++ b/index.js @@ -64,9 +64,9 @@ function parseDirectories(file, depth, targetDirectory) { } function buildMatrix(changedDirectories) { - include = []; - var directory; - for (directory of changedDirectories) { + let directories = [...new Set(changedDirectories)]; + let include = [] + for (directory of directories) { include.push({'directory': directory}); } return {'include': include};