@@ -69,22 +69,17 @@ const preview = {
69
69
70
70
const allFiles = await globPromise ( `${ data . inputDir . replace ( / \\ / g, '/' ) } /**/*` ) ;
71
71
72
- const filesArray = await Promise . all (
73
- ( await Promise . all (
74
- allFiles . map ( async file => {
75
- if ( ( await fs . promises . lstat ( file ) ) . isFile ( ) ) {
76
- return file
77
- }
72
+ const filesArray = ( await Promise . all ( allFiles . map ( async file => {
73
+ if ( ( await fs . promises . lstat ( file ) ) . isFile ( ) ) {
74
+ return new PutObjectCommand ( {
75
+ Bucket : data . bucket ,
76
+ Key : data . outputDir + path . relative ( data . inputDir , file ) . replace ( / \\ / g, '/' ) ,
77
+ ContentType : mime . lookup ( file ) ,
78
+ Body : await fs . promises . readFile ( file ) ,
78
79
} )
79
- ) )
80
- . filter ( file => file !== undefined )
81
- . map ( async file => new PutObjectCommand ( {
82
- Bucket : data . bucket ,
83
- Key : data . outputDir + path . relative ( data . inputDir , file ) . replace ( / \\ / g, '/' ) ,
84
- ContentType : mime . lookup ( file ) ,
85
- Body : await fs . promises . readFile ( file ) ,
86
- } ) )
87
- )
80
+ }
81
+ } ) ) )
82
+ . filter ( file => file !== undefined )
88
83
89
84
const progressBar = new cliProgress . SingleBar ( { } , cliProgress . Presets . shades_classic ) ;
90
85
progressBar . start ( filesArray . length , 0 ) ;
0 commit comments