diff --git a/lib/get-files.js b/lib/get-files.js index 9f03b4e..2675206 100644 --- a/lib/get-files.js +++ b/lib/get-files.js @@ -129,15 +129,15 @@ const explode = async function (paths, ignored, { limit, debug }) { s = await stat(path); } + if (isIgnored(file, ignored)) { + if (debug) console.log(`> [debug] Ignoring "${file}"`); + return null; + } + if (s.isDirectory()) { const all = await readdir(file); return many(all.map(subdir => asAbsolute(subdir, file))); } else { - if (isIgnored(file, ignored)) { - if (debug) console.log(`> [debug] Ignoring "${file}"`); - return null; - } - if (null != limit && s.size > limit) { console.error(`> \u001b[31mWarning!\u001b[39m Skipping file ` + `over ${bytes(limit)}: ${path}`);