oops i accidentally parsed 3x the files i needed
This commit is contained in:
parent
89cbcd85a4
commit
aa1c665421
6
index.js
6
index.js
|
@ -180,14 +180,14 @@ function parse(code) {
|
||||||
return elements;
|
return elements;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function recursiveReaddir(rpath, p, fileNames) {
|
async function recursiveReaddir(rpath, p) {
|
||||||
p = p || '';
|
p = p || '';
|
||||||
fileNames = (fileNames || []).slice();
|
let fileNames = [];
|
||||||
const files = await fs.readdir(rpath);
|
const files = await fs.readdir(rpath);
|
||||||
for (const f of files) {
|
for (const f of files) {
|
||||||
const stat = await fs.lstat(path.join(rpath, f));
|
const stat = await fs.lstat(path.join(rpath, f));
|
||||||
if (stat.isDirectory() || stat.isSymbolicLink()) {
|
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 {
|
} else {
|
||||||
fileNames.push(p + f);
|
fileNames.push(p + f);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue