1
- const fs = require ( "fs-extra " ) ;
1
+ const fs = require ( "node:fs " ) ;
2
2
const yargs = require ( "yargs" ) ;
3
3
const path = require ( "path" ) ;
4
4
@@ -12,18 +12,18 @@ const args = yargs(process.argv)
12
12
13
13
// Function to copy CSS and generate shared-styles.html
14
14
async function copyAndGenerateSharedStyles ( sourceCss , mainCss ) {
15
- await fs . copy ( sourceCss , path . join ( "css" , "currentStyle.css" ) ) ;
15
+ await fs . promises . cp ( sourceCss , path . join ( "css" , "currentStyle.css" ) ) ;
16
16
17
17
// Read the main CSS file
18
- const mainCssContent = await fs . readFile ( mainCss , "utf8" ) ;
18
+ const mainCssContent = await fs . promises . readFile ( mainCss , "utf8" ) ;
19
19
20
20
// Generate shared-styles.html content
21
21
const sharedStylesContent = `<dom-module id="shared-styles"><template><style>${ mainCssContent } </style></template></dom-module>` ;
22
22
23
23
// Write shared-styles.html
24
- await fs . writeFile (
24
+ await fs . promises . writeFile (
25
25
path . join ( "polymer-v2.0.0-non-keyed" , "src" , "shared-styles.html" ) ,
26
- sharedStylesContent
26
+ sharedStylesContent ,
27
27
) ;
28
28
}
29
29
@@ -39,12 +39,12 @@ async function configureStyles() {
39
39
if ( args . bootstrap ) {
40
40
await copyAndGenerateSharedStyles (
41
41
path . join ( "css" , "useOriginalBootstrap.css" ) ,
42
- path . join ( "css" , "bootstrap" , "dist" , "css" , "bootstrap.min.css" )
42
+ path . join ( "css" , "bootstrap" , "dist" , "css" , "bootstrap.min.css" ) ,
43
43
) ;
44
44
} else {
45
45
await copyAndGenerateSharedStyles (
46
46
path . join ( "css" , "useMinimalCss.css" ) ,
47
- path . join ( "css" , "useMinimalCss.css" )
47
+ path . join ( "css" , "useMinimalCss.css" ) ,
48
48
) ;
49
49
}
50
50
} catch ( error ) {
0 commit comments