File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,8 @@ async function transformDir(p) {
7575 } else {
7676 dereferenceFns . push ( async ( ) => {
7777 await fs . unlink ( subPath ) ;
78- await fs . cp ( realTarget , subPath , { recursive : true } ) ;
78+ // Note: NodeJS `fs.cp` can have issues when sources are readonly.
79+ await exec ( `cp -R ${ realTarget } ${ subPath } ` ) ;
7980 } ) ;
8081 }
8182 } else if ( file . isDirectory ( ) ) {
@@ -86,7 +87,7 @@ async function transformDir(p) {
8687 await Promise . all ( directoriesToVisit . map ( ( d ) => transformDir ( d ) ) ) ;
8788}
8889
89- function exec ( cmd , maxRetries = 2 ) {
90+ function exec ( cmd , maxRetries = 3 ) {
9091 return new Promise ( ( resolve , reject ) => {
9192 childProcess . exec ( cmd , { cwd : rootDir } , ( error ) => {
9293 if ( error !== null ) {
@@ -119,7 +120,7 @@ try {
119120 // Re-link symlinks to work inside Windows.
120121 // This is done in batches to avoid flakiness due to WSL
121122 // See: https://github.com/microsoft/WSL/issues/8677.
122- const batchSize = 100 ;
123+ const batchSize = 75 ;
123124 for ( let i = 0 ; i < relinkFns . length ; i += batchSize ) {
124125 await Promise . all ( relinkFns . slice ( i , i + batchSize ) . map ( ( fn ) => fn ( ) ) ) ;
125126 }
You can’t perform that action at this time.
0 commit comments