File tree 1 file changed +4
-3
lines changed
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) {
75
75
} else {
76
76
dereferenceFns . push ( async ( ) => {
77
77
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 } ` ) ;
79
80
} ) ;
80
81
}
81
82
} else if ( file . isDirectory ( ) ) {
@@ -86,7 +87,7 @@ async function transformDir(p) {
86
87
await Promise . all ( directoriesToVisit . map ( ( d ) => transformDir ( d ) ) ) ;
87
88
}
88
89
89
- function exec ( cmd , maxRetries = 2 ) {
90
+ function exec ( cmd , maxRetries = 3 ) {
90
91
return new Promise ( ( resolve , reject ) => {
91
92
childProcess . exec ( cmd , { cwd : rootDir } , ( error ) => {
92
93
if ( error !== null ) {
@@ -119,7 +120,7 @@ try {
119
120
// Re-link symlinks to work inside Windows.
120
121
// This is done in batches to avoid flakiness due to WSL
121
122
// See: https://github.com/microsoft/WSL/issues/8677.
122
- const batchSize = 100 ;
123
+ const batchSize = 75 ;
123
124
for ( let i = 0 ; i < relinkFns . length ; i += batchSize ) {
124
125
await Promise . all ( relinkFns . slice ( i , i + batchSize ) . map ( ( fn ) => fn ( ) ) ) ;
125
126
}
You can’t perform that action at this time.
0 commit comments