diff --git a/lib/index.js b/lib/index.js index dab346f..3a6afdd 100644 --- a/lib/index.js +++ b/lib/index.js @@ -155,7 +155,7 @@ const flattenChildItems = (currentTier, flatData) => { const saveFiles = (opts, done) => { const filesSaved = [] - filesToSave.forEach(file => { + function saveFile(file) { const {src, origin} = file const fileName = src.substr(src.lastIndexOf('/') + 1, src.length) const destFileName = `${opts.filePath}/${fileName}` @@ -169,6 +169,16 @@ const saveFiles = (opts, done) => { done() } }) + } + + filesToSave.forEach(file => { + if (Array.isArray(file)) { + for (const individualFile of file) { + saveFile(individualFile) + } + } else { + saveFile(file) + } }) }