File tree Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -306,23 +306,23 @@ export const buildCommand: yargs.CommandModule<
306306 updateSpinnerMessage ( index , "Writing files to sandbox..." )
307307 ) ;
308308
309- await Promise . all (
310- filePaths . map ( ( filePath ) =>
311- retryWithDelay (
312- async ( ) => {
309+ // Use batch write for more efficient file uploads
310+ await retryWithDelay (
311+ async ( ) => {
312+ const files = await Promise . all (
313+ filePaths . map ( async ( filePath ) => {
313314 const fullPath = path . join ( argv . directory , filePath ) ;
314315 const content = await fs . readFile ( fullPath ) ;
315- const dirname = path . dirname ( filePath ) ;
316- await session . fs . mkdir ( dirname , true ) ;
317- await session . fs . writeFile ( filePath , content , {
318- create : true ,
319- overwrite : true ,
320- } ) ;
321- } ,
322- 3 ,
323- 200
324- )
325- )
316+ return {
317+ path : filePath ,
318+ content,
319+ } ;
320+ } )
321+ ) ;
322+ await session . fs . batchWrite ( files ) ;
323+ } ,
324+ 3 ,
325+ 200
326326 ) . catch ( ( error ) => {
327327 throw new Error ( `Failed to write files to sandbox: ${ error } ` ) ;
328328 } ) ;
You can’t perform that action at this time.
0 commit comments