File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed
packages/docusaurus/src/commands Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,8 @@ export async function buildLocale({
8080 } ) ,
8181
8282 // We also clear website/build dir
83- // void, no useful result but need to be done before compilation
83+ // returns void, no useful result needed before compilation
84+ // See also https://github.com/facebook/docusaurus/pull/11037
8485 clearPath ( outDir ) ,
8586 ] ) ,
8687 ) ;
Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ import {
1515import clearPath from './utils/clearPath' ;
1616
1717async function removePath ( entry : { path : string ; description : string } ) {
18+ if ( ! ( await fs . pathExists ( entry . path ) ) ) {
19+ return ;
20+ }
1821 try {
1922 await clearPath ( entry . path ) ;
2023 logger . success `Removed the ${ entry . description } at path=${ path . relative (
Original file line number Diff line number Diff line change 55 * LICENSE file in the root directory of this source tree.
66 */
77
8- import fs from 'fs-extra' ;
98import path from 'path' ;
9+ import { rm } from 'fs/promises' ;
1010import { PerfLogger } from '@docusaurus/logger' ;
1111
1212/**
@@ -16,10 +16,7 @@ export default async function clearPath(pathToClear: string): Promise<void> {
1616 return PerfLogger . async (
1717 `clearPath ${ path . relative ( process . cwd ( ) , pathToClear ) } ` ,
1818 async ( ) => {
19- if ( ! ( await fs . pathExists ( pathToClear ) ) ) {
20- return ;
21- }
22- await fs . remove ( pathToClear ) ;
19+ await rm ( pathToClear , { recursive : true , force : true } ) ;
2320 } ,
2421 ) ;
2522}
You can’t perform that action at this time.
0 commit comments