Skip to content

Commit d6c6dc9

Browse files
committed
try/catch opening the v3 CLI login URL. Fix for Ubuntu
1 parent 27de884 commit d6c6dc9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/gorgeous-cycles-guess.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
try/catch opening the login URL

packages/cli-v3/src/commands/login.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,10 @@ export async function login(options?: LoginOptions): Promise<LoginResult> {
204204
`Please visit the following URL to login:\n${chalkLink(authorizationCodeResult.url)}`
205205
);
206206

207-
await open(authorizationCodeResult.url);
207+
try {
208+
//this can throw an error on Ubuntu
209+
await open(authorizationCodeResult.url);
210+
} catch (e) {}
208211

209212
//poll for personal access token (we need to poll for it)
210213
const getPersonalAccessTokenSpinner = spinner();

0 commit comments

Comments
 (0)