From 83d180fc477b17bf33c7673f010b68e9f7d5e0a2 Mon Sep 17 00:00:00 2001 From: Tobbe Lundberg Date: Mon, 18 Sep 2023 08:54:07 +0200 Subject: [PATCH] RSC: Check if index.html has already been updated during setup (#9197) With this check in place it's now safe to run the setup command multiple times, which is great when testing it. --- .../cli/src/commands/experimental/setupRscHandler.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/cli/src/commands/experimental/setupRscHandler.js b/packages/cli/src/commands/experimental/setupRscHandler.js index aeb2d74ccd47..059a7de7b235 100644 --- a/packages/cli/src/commands/experimental/setupRscHandler.js +++ b/packages/cli/src/commands/experimental/setupRscHandler.js @@ -158,6 +158,16 @@ export const handler = async ({ force, verbose }) => { title: 'Updating index.html...', task: async () => { let indexHtml = fs.readFileSync(rwPaths.web.html, 'utf-8') + + if ( + /\n\s*'