File tree 1 file changed +10
-8
lines changed
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -20,17 +20,19 @@ async function copyFiles(sourceDir, targetDir) {
20
20
21
21
const files = await fs . readdir ( sourceDir ) ;
22
22
23
- await Promise . all ( files . map ( async ( file ) => {
24
- const sourcePath = path . join ( sourceDir , file ) ;
25
- const targetPath = path . join ( targetDir , file ) ;
23
+ await Promise . all (
24
+ files . map ( async ( file ) => {
25
+ const sourcePath = path . join ( sourceDir , file ) ;
26
+ const targetPath = path . join ( targetDir , file ) ;
26
27
27
- await fs . copyFile ( sourcePath , targetPath ) ;
28
- console . log ( `Copied ${ file } to ${ targetPath } ` ) ;
29
- } ) ) ;
28
+ await fs . copyFile ( sourcePath , targetPath ) ;
29
+ console . info ( `Copied ${ file } to ${ targetPath } ` ) ;
30
+ } ) ,
31
+ ) ;
30
32
31
- console . log ( ' All files copied successfully' ) ;
33
+ console . info ( " All files copied successfully" ) ;
32
34
} catch ( error ) {
33
- console . error ( ' An error occurred:' , error . message ) ;
35
+ console . error ( " An error occurred:" , error . message ) ;
34
36
process . exit ( 1 ) ;
35
37
}
36
38
}
You can’t perform that action at this time.
0 commit comments