Skip to content

Commit f032a58

Browse files
committed
emit error if one of the main entries is missing
1 parent c87e65b commit f032a58

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,8 @@ function normalize (name) {
326326
}
327327

328328
function statAll (fs, stat, cwd, ignore, entries, sort) {
329-
const queue = (entries || ['.']).slice(0)
329+
if (!entries) entries = ['.']
330+
const queue = entries.slice(0)
330331

331332
return function loop (callback) {
332333
if (!queue.length) return callback(null)
@@ -336,7 +337,7 @@ function statAll (fs, stat, cwd, ignore, entries, sort) {
336337

337338
stat.call(fs, nextAbs, function (err, stat) {
338339
// ignore errors if the files were deleted while buffering
339-
if (err) return callback(err.code === 'ENOENT' ? null : err)
340+
if (err) return callback(entries.indexOf(next) === -1 && err.code === 'ENOENT' ? null : err)
340341

341342
if (!stat.isDirectory()) return callback(null, next, stat)
342343

0 commit comments

Comments
 (0)