From f4d92df00bc555fe157273c6cca2ad3aab4cb4ce Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 27 Feb 2023 09:48:52 +0100 Subject: [PATCH] fix(cli): make cli resilient to systems without openable browsers --- cli/login.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/login.ts b/cli/login.ts index 399566af0a..8332f909d4 100644 --- a/cli/login.ts +++ b/cli/login.ts @@ -51,9 +51,11 @@ export async function browserLogin( const url = `${baseUrl}user/cli?port=${port}` console.log(`Login by going to ${url}`); try { - open(url) + await open(url) console.log("Opened browser for you"); - } catch { } + } catch { + console.error(`Failed to open browser, please navgiate to ${url}`) + } const firstConnection = await server.accept(); const httpFirstConnection = Deno.serveHttp(firstConnection); const firstRequest = (await httpFirstConnection.nextRequest())!;