From 05488c81e07016376d95ec1b7716075a572bd252 Mon Sep 17 00:00:00 2001 From: timothycarambat Date: Thu, 23 May 2024 12:04:00 -0700 Subject: [PATCH] undo path norm whitespace fix --- collector/utils/files/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/collector/utils/files/index.js b/collector/utils/files/index.js index 51d0a682..3471654f 100644 --- a/collector/utils/files/index.js +++ b/collector/utils/files/index.js @@ -49,9 +49,9 @@ function writeToServerDocuments( const destination = destinationOverride ? path.resolve(destinationOverride) : path.resolve( - __dirname, - "../../../server/storage/documents/custom-documents" - ); + __dirname, + "../../../server/storage/documents/custom-documents" + ); if (!fs.existsSync(destination)) fs.mkdirSync(destination, { recursive: true }); const destinationFilePath = path.resolve(destination, filename) + ".json"; @@ -82,7 +82,7 @@ async function wipeCollectorStorage() { if (file === "__HOTDIR__.md") continue; try { fs.rmSync(path.join(directory, file)); - } catch {} + } catch { } } resolve(); }); @@ -97,7 +97,7 @@ async function wipeCollectorStorage() { if (file === ".placeholder") continue; try { fs.rmSync(path.join(directory, file)); - } catch {} + } catch { } } resolve(); }); @@ -122,7 +122,7 @@ function isWithin(outer, inner) { function normalizePath(filepath = "") { const result = path - .normalize(filepath.replace(/\s/g, "-").trim()) + .normalize(filepath.trim()) .replace(/^(\.\.(\/|\\|$))+/, "") .trim(); if (["..", ".", "/"].includes(result)) throw new Error("Invalid path.");