oops i accidentally parsed 3x the files i needed

This commit is contained in:
Jill 2021-11-04 09:19:28 +03:00
parent 89cbcd85a4
commit aa1c665421
1 changed files with 3 additions and 3 deletions

View File

@ -180,14 +180,14 @@ function parse(code) {
return elements;
}
async function recursiveReaddir(rpath, p, fileNames) {
async function recursiveReaddir(rpath, p) {
p = p || '';
fileNames = (fileNames || []).slice();
let fileNames = [];
const files = await fs.readdir(rpath);
for (const f of files) {
const stat = await fs.lstat(path.join(rpath, f));
if (stat.isDirectory() || stat.isSymbolicLink()) {
fileNames.push(...await recursiveReaddir(path.join(rpath, f), p + f + '/', fileNames));
fileNames.push(...await recursiveReaddir(path.join(rpath, f), p + f + '/'));
} else {
fileNames.push(p + f);
}