fix: (regression beta) missing source caused forever loading of list #878

Massimo Melina committed Jan 23, 2025 at 14:24 UTC a4885cab12e28d18e7ff1fd34e8b20f136305bd7
1 file changed +1 -1
src/walkDir.ts
+1 -1
@@ -23,7 +23,7 @@ export function walkDir(path: string, { depth = 0, hidden = true }: {
23 const closingQ: string[] = []
24 return new Promise(async (resolve, reject) => {
25 if (!await isDirectory(path))
26 - throw Error('ENOTDIR')
26 + return reject(Error('ENOTDIR'))
27 dirQ.add(() => readDir('', depth)
28 .then(res => { // don't make the job await for it, but use it to know it's over
29 Promise.resolve(res?.branchDone).then(resolve)