refactor: fix a few places of path handling (#7023)

This commit is contained in:
Joshua Chen 2022-03-26 22:49:50 +08:00 committed by GitHub
parent e6838dd7a6
commit 4957ec947b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 15 deletions

View file

@ -9,7 +9,6 @@ import {Feed, type Author as FeedAuthor, type Item as FeedItem} from 'feed';
import type {BlogPost} from './types';
import {
normalizeUrl,
posixPath,
mapAsyncSequential,
readOutputHTMLFile,
} from '@docusaurus/utils';
@ -128,10 +127,7 @@ async function createBlogFeedFile({
}
})();
try {
await fs.outputFile(
posixPath(path.join(generatePath, feedPath)),
feedContent,
);
await fs.outputFile(path.join(generatePath, feedPath), feedContent);
} catch (err) {
throw new Error(`Generating ${feedType} feed failed: ${err}.`);
}