Skip to content

Commit 1556166

Browse files
Brian Vaughnzhengjitf
authored andcommitted
Fixed broken build script --unsafe-partial flag (facebook#22324)
This flag was broken due to a buggy race case in the ncp() command. The fix is amittedly a hack but improves on the existing behavior (of leaving the workspace in a broken state).
1 parent 2302379 commit 1556166

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

scripts/rollup/utils.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ function asyncCopyTo(from, to) {
1515
if (error) {
1616
// Wrap to have a useful stack trace.
1717
reject(new Error(error));
18-
return;
18+
} else {
19+
// Wait for copied files to exist; ncp() sometimes completes prematurely.
20+
// For more detail, see github.com/facebook/react/issues/22323
21+
// Also github.com/AvianFlu/ncp/issues/127
22+
setTimeout(resolve, 10);
1923
}
20-
resolve();
2124
});
2225
})
2326
);

0 commit comments

Comments
 (0)