From 91d63f7839b596437951146849b56109ff6b7ea5 Mon Sep 17 00:00:00 2001 From: myfreeer Date: Tue, 26 May 2020 22:45:39 +0800 Subject: [PATCH] merge: only merge from non-empty samples --- mdn-merge-samples.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mdn-merge-samples.js b/mdn-merge-samples.js index b9f3901e..109d9f6b 100644 --- a/mdn-merge-samples.js +++ b/mdn-merge-samples.js @@ -98,7 +98,7 @@ const mergeSamples = async (...basePath) => { for (let k = 0; k < compareSamples.sampleArray.length; k++) { let compareItem = compareSamples.sampleArray[k]; let item = currentSamples.map[compareItem.key]; - if (!item || (item.isEmpty && !compareItem.isEmpty)) { + if (compareItem && !compareItem.isEmpty && (!item || item.isEmpty)) { copyFilePromiseArray.push(copyAndMkdir( path.join(compareItem.cwd, compareItem.path), path.join(cwd, locale, compareItem.key))