From 553d6b9a35473971f51a5ecfdd9887bc7fdff1d2 Mon Sep 17 00:00:00 2001 From: soulgalore Date: Mon, 30 Dec 2024 05:48:58 +0100 Subject: [PATCH] fix: follow same structure as before --- lib/support/fileUtil.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/support/fileUtil.js b/lib/support/fileUtil.js index 383a09d324..5f1154e947 100644 --- a/lib/support/fileUtil.js +++ b/lib/support/fileUtil.js @@ -1,7 +1,7 @@ import { readdir } from 'node:fs/promises'; import path from 'node:path'; -export async function recursiveReaddir(dir, includeDirectories = false) { +export async function recursiveReaddir(dir, ignoreDirectories = false) { const results = []; const entries = await readdir(dir, { withFileTypes: true }); @@ -9,10 +9,10 @@ export async function recursiveReaddir(dir, includeDirectories = false) { const fullPath = path.join(dir, entry.name); if (entry.isDirectory()) { - if (includeDirectories) { + if (!ignoreDirectories) { results.push(fullPath); } - const subPaths = await recursiveReaddir(fullPath, includeDirectories); + const subPaths = await recursiveReaddir(fullPath, ignoreDirectories); results.push(...subPaths); } else { results.push(fullPath);