From 0cb5331c318d8beb5cd550e33692c21910a39ce6 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 13 Oct 2023 07:18:10 -0700 Subject: [PATCH] Fix spurious server build error on MacOS Summary: Copying files will randomly fail with something akin to ``` Error: Cannot copy '../acirb/bin/acorn' to a subdirectory of itself, '../acorn/bin/acorn'. ``` See https://github.com/jprichardson/node-fs-extra/issues/708 Reviewed By: antonk52 Differential Revision: D50263977 fbshipit-source-id: 39091ef57b79c692ec89e7a250595509839e2af8 --- desktop/scripts/build-flipper-server-release.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desktop/scripts/build-flipper-server-release.tsx b/desktop/scripts/build-flipper-server-release.tsx index 7b63181b2..18f636be1 100644 --- a/desktop/scripts/build-flipper-server-release.tsx +++ b/desktop/scripts/build-flipper-server-release.tsx @@ -733,7 +733,10 @@ async function bundleServerReleaseForPlatform( } console.log(`⚙️ Copying from ${dir} to ${outputPaths.resourcesPath}`); - await fs.copy(dir, outputPaths.resourcesPath); + await fs.copy(dir, outputPaths.resourcesPath, { + overwrite: true, + dereference: true, + }); console.log(`⚙️ Downloading compatible node version`); await installNodeBinary(outputPaths.nodePath, platform);