Skip to content

Commit

Permalink
emit error if one of the main entries is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Jun 20, 2023
1 parent c87e65b commit f032a58
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@ function normalize (name) {
}

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

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

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

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

Expand Down

0 comments on commit f032a58

Please sign in to comment.