Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 962a0f8

Browse files
committed
Handle empty directories.
1 parent cb32493 commit 962a0f8

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/files.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -355,15 +355,19 @@ module.exports = (common) => {
355355
// accumulate the files and their content
356356
var files = []
357357
stream.pipe(through.obj((file, enc, next) => {
358-
file.content.pipe(concat((content) => {
359-
files.push({
360-
path: file.path,
361-
content: content
362-
})
358+
if (file.content) {
359+
file.content.pipe(concat((content) => {
360+
files.push({
361+
path: file.path,
362+
content: content
363+
})
364+
next()
365+
}))
366+
} else {
367+
files.push(file)
363368
next()
364-
}))
369+
}
365370
}, () => {
366-
expect(files).to.be.length(10)
367371
var paths = files.map((file) => {
368372
return file.path
369373
})

0 commit comments

Comments
 (0)