diff options
Diffstat (limited to 'src/crawl-local.js')
-rwxr-xr-x | src/crawl-local.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/crawl-local.js b/src/crawl-local.js index cf5db87..6d245ae 100755 --- a/src/crawl-local.js +++ b/src/crawl-local.js @@ -19,17 +19,15 @@ function crawl(dirPath) { return stat(itemPath).then(stats => { if (stats.isDirectory()) { - return crawl(itemPath).then(contents => { - const group = {name: item, items: contents} - return group - }) + return crawl(itemPath) + .then(group => Object.assign(group, {name: item})) } else if (stats.isFile()) { const track = {name: item, downloaderArg: itemPath} return track } }) })) - }) + }).then(items => ({items})) } if (process.argv.length === 2) { |