@@ -4,7 +4,8 @@ const path = require('path');
4
4
5
5
// Define the source and destination directories
6
6
const sourceDir = path . join ( __dirname , '..' , 'docs' ) ;
7
- const destDir = path . join ( __dirname , '..' , 'static' ) ;
7
+ const destDir1 = path . join ( __dirname , '..' , 'static' ) ;
8
+ const destDir2 = path . join ( __dirname , '..' , 'static/examples' ) ;
8
9
9
10
// Find all .html files in the source directory
10
11
glob ( `${ sourceDir } /**/*.html` , ( err , files ) => {
@@ -15,13 +16,18 @@ glob(`${sourceDir}/**/*.html`, (err, files) => {
15
16
16
17
console . log ( 'Found files:' , files ) ;
17
18
18
- // Copy each file to the destination directory
19
+ // Copy each file to the destination directories
19
20
files . forEach ( file => {
20
21
const relativePath = path . relative ( sourceDir , file ) ;
21
- const destFile = path . join ( destDir , relativePath ) ;
22
+ const destFile1 = path . join ( destDir1 , relativePath ) ;
23
+ const destFile2 = path . join ( destDir2 , relativePath ) ;
22
24
23
- fs . copy ( file , destFile )
24
- . then ( ( ) => console . log ( `Copied ${ file } to ${ destFile } ` ) )
25
+ fs . copy ( file , destFile1 )
26
+ . then ( ( ) => console . log ( `Copied ${ file } to ${ destFile1 } ` ) )
27
+ . catch ( err => console . error ( err ) ) ;
28
+
29
+ fs . copy ( file , destFile2 )
30
+ . then ( ( ) => console . log ( `Copied ${ file } to ${ destFile2 } ` ) )
25
31
. catch ( err => console . error ( err ) ) ;
26
32
} ) ;
27
33
} ) ;
0 commit comments