From cacaf54e6178d9d9b0843fb3b79ae6f26b2fc9a4 Mon Sep 17 00:00:00 2001 From: Aidan Jones Date: Fri, 24 May 2024 21:53:40 -0400 Subject: [PATCH] Don't write pkf file if there is no docSet Not sure on this. Will probably introduce a whole host of issues with the actual app, regarding fetching data. --- convert/convertBooks.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/convert/convertBooks.ts b/convert/convertBooks.ts index 324b8a612..dd62e0ab0 100644 --- a/convert/convertBooks.ts +++ b/convert/convertBooks.ts @@ -299,12 +299,15 @@ export async function convertBooks( //write frozen archives //push files to be written to files array - freezer.forEach((value, key) => - files.push({ - path: path.join('static', 'collections', key + '.pkf'), - content: value - }) - ); + freezer.forEach((value, key) => { + // don't write pkf if there is nothing to write + if (value) { + files.push({ + path: path.join('static', 'collections', key + '.pkf'), + content: value + }); + } + }); //write index file writeFileSync(