refactor: convert all fs methods to async (#6725)

* refactor: convert all fs methods to async

* fix snap
This commit is contained in:
Joshua Chen 2022-02-20 10:21:33 +08:00 committed by GitHub
parent c0b3c9af65
commit c6d0d812eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 518 additions and 429 deletions

View file

@ -36,13 +36,13 @@
"algoliasearch-helper": "^3.7.0",
"clsx": "^1.1.1",
"eta": "^1.12.3",
"fs-extra": "^10.0.0",
"lodash": "^4.17.21",
"tslib": "^2.3.1",
"utility-types": "^3.10.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.15",
"fs-extra": "^10.0.0"
"@docusaurus/module-type-aliases": "2.0.0-beta.15"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",

View file

@ -6,7 +6,7 @@
*/
import path from 'path';
import fs from 'fs';
import fs from 'fs-extra';
import {defaultConfig, compile} from 'eta';
import {normalizeUrl} from '@docusaurus/utils';
import {readDefaultCodeTranslationMessages} from '@docusaurus/theme-translations';
@ -76,7 +76,7 @@ export default function themeSearchAlgolia(context: LoadContext): Plugin<void> {
const siteUrl = normalizeUrl([url, baseUrl]);
try {
fs.writeFileSync(
await fs.writeFile(
path.join(outDir, OPEN_SEARCH_FILENAME),
renderOpenSearchTemplate({
title,