Skip to content

Commit

Permalink
Update registerAsync.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBacon committed Jan 28, 2022
1 parent c31e21f commit cbeaabe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/expo/cli/register/registerAsync.ts
Expand Up @@ -16,17 +16,19 @@ export async function registerAsync() {
}

const registrationUrl = `https://expo.dev/signup`;

const failedMessage = `Unable to open a web browser. Register an account at: ${registrationUrl}`;
const spinner = ora(`Opening ${registrationUrl}`).start();
try {
const opened = openBrowserAsync(registrationUrl);
const opened = await openBrowserAsync(registrationUrl);

if (opened) {
spinner.succeed(`Opened ${registrationUrl}`);
} else {
spinner.fail(failedMessage);
}
return;
} catch (error) {
spinner.fail(`Unable to open a web browser. Register an account at: ${registrationUrl}`);
spinner.fail(failedMessage);
throw error;
}
}

0 comments on commit cbeaabe

Please sign in to comment.