From 92d14541407038e8db53a0f61515c68cbfa866a5 Mon Sep 17 00:00:00 2001 From: Lorenzo Blasa Date: Wed, 8 Nov 2023 09:20:13 -0800 Subject: [PATCH] Open flag when starting server in debug mode Summary: It was hard-coded to always open the first time. This allows to run the server on debug mode without opening UI. Reviewed By: antonk52 Differential Revision: D51115746 fbshipit-source-id: 9467f0fbff45987247a2bb3bf5eb1aa578de1913 --- desktop/scripts/start-flipper-server-dev.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/desktop/scripts/start-flipper-server-dev.tsx b/desktop/scripts/start-flipper-server-dev.tsx index af87be91b..75056c22d 100644 --- a/desktop/scripts/start-flipper-server-dev.tsx +++ b/desktop/scripts/start-flipper-server-dev.tsx @@ -49,6 +49,11 @@ const argv = yargs choices: ['stable', 'insiders'], default: 'stable', }, + open: { + describe: 'Open Flipper in the default browser after starting', + type: 'boolean', + default: true, + }, }) .version('DEV') .help() @@ -103,7 +108,9 @@ async function copyStaticResources() { async function restartServer() { try { await compileServerMain(); - await launchServer(true, ++startCount === 1); // only open on the first time + // Only open the UI the first time it runs. Subsequent runs, likely triggered after + // saving changes, should just reload the existing UI. + await launchServer(true, argv.open && ++startCount === 1); } catch (e) { console.error( chalk.red(