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

Commit cd8a159

Browse files
committed
Handle empty directories.
1 parent 4c53976 commit cd8a159

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
@@ -352,15 +352,19 @@ module.exports = (common) => {
352352
// accumulate the files and their content
353353
var files = []
354354
stream.pipe(through.obj((file, enc, next) => {
355-
file.content.pipe(concat((content) => {
356-
files.push({
357-
path: file.path,
358-
content: content
359-
})
355+
if (file.content) {
356+
file.content.pipe(concat((content) => {
357+
files.push({
358+
path: file.path,
359+
content: content
360+
})
361+
next()
362+
}))
363+
} else {
364+
files.push(file)
360365
next()
361-
}))
366+
}
362367
}, () => {
363-
expect(files).to.be.length(10)
364368
var paths = files.map((file) => {
365369
return file.path
366370
})

0 commit comments

Comments
 (0)