Skip to content

Commit

Permalink
fix(v2): use synchronous write for generate blog feeds (facebook#2540)
Browse files Browse the repository at this point in the history
* fix(v2): use synchronous write for generate blog feeds

* FIx code style
  • Loading branch information
lex111 authored and mohrash92 committed Apr 11, 2020
1 parent 391848e commit 1463ed1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/docusaurus-plugin-content-blog/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,11 @@ export default function pluginContentBlog(
`${feedType}.xml`,
);
const feedContent = feedType === 'rss' ? feed.rss2() : feed.atom1();
return fs.writeFile(feedPath, feedContent, (err) => {
if (err) {
throw new Error(`Generating ${feedType} feed failed: ${err}`);
}
});
try {
fs.writeFileSync(feedPath, feedContent);
} catch (err) {
throw new Error(`Generating ${feedType} feed failed: ${err}`);
}
}),
);
},
Expand Down

0 comments on commit 1463ed1

Please sign in to comment.