File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,13 +34,15 @@ export const resolveHttpsConfig = async (
3434 ) ;
3535
3636 if ( fs . existsSync ( certPath ) ) {
37- const stats = fs . statSync ( certPath ) ;
37+ const stats = await fs . promises . stat ( certPath ) ;
3838 const timeDiff = Date . now ( ) - stats . mtimeMs ;
3939 const daysDiff = timeDiff / ( 1000 * 60 * 60 * 24 ) ;
4040
4141 // Default validity period is 30 days
4242 if ( daysDiff < 30 ) {
43- const content = fs . readFileSync ( certPath , { encoding : 'utf-8' } ) ;
43+ const content = await fs . promises . readFile ( certPath , {
44+ encoding : 'utf-8' ,
45+ } ) ;
4446 return {
4547 key : content ,
4648 cert : content ,
@@ -62,7 +64,7 @@ export const resolveHttpsConfig = async (
6264 await ensureDir ( options . outputPath ) ;
6365 }
6466
65- fs . writeFileSync ( certPath , content , { encoding : 'utf-8' } ) ;
67+ await fs . promises . writeFile ( certPath , content , { encoding : 'utf-8' } ) ;
6668
6769 return {
6870 key : content ,
You can’t perform that action at this time.
0 commit comments