From 15936ff8b83a1272442550bc0f55890efd7059d6 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 10 Mar 2025 17:57:56 +0200 Subject: [PATCH] fix(edit-docs): relative path --- electron-docs-main.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/electron-docs-main.ts b/electron-docs-main.ts index 507ae0069..edd8fddea 100644 --- a/electron-docs-main.ts +++ b/electron-docs-main.ts @@ -58,8 +58,7 @@ async function createImportZip() { }); async function iterate(currentPath: string) { - console.log("Found ", currentPath); - for (const entry of await fs.readdir(currentPath, { withFileTypes: true })) { + for (const entry of await fs.readdir(path.join(destRootPath, currentPath), { withFileTypes: true })) { const entryPath = path.join(currentPath, entry.name); if (entry.isDirectory()) { @@ -67,14 +66,14 @@ async function createImportZip() { continue; } - const source = fsExtra.createReadStream(entryPath); + const source = fsExtra.createReadStream(path.join(destRootPath, entryPath)); archive.append(source, { - name: entryPath + name: path.join(currentPath, entry.name) }); } } - await iterate(destRootPath); + await iterate("/"); const outputStream = fsExtra.createWriteStream("input.zip"); archive.pipe(outputStream);