Skip to content

Commit

Permalink
Don't write pkf file if there is no docSet
Browse files Browse the repository at this point in the history
Not sure on this. Will probably introduce a whole host of issues with the actual app, regarding fetching data.
  • Loading branch information
FyreByrd committed May 25, 2024
1 parent da35566 commit cacaf54
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions convert/convertBooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit cacaf54

Please sign in to comment.