xref: /expo/packages/@expo/cli/src/register/index.ts (revision e5f02478)
1#!/usr/bin/env node
2import chalk from 'chalk';
3
4import { Command } from '../../bin/cli';
5import * as Log from '../log';
6import { assertArgs } from '../utils/args';
7import { logCmdError } from '../utils/errors';
8
9export const expoRegister: Command = async (argv) => {
10  const args = assertArgs(
11    {
12      // Types
13      '--help': Boolean,
14      // Aliases
15      '-h': '--help',
16    },
17    argv
18  );
19
20  if (args['--help']) {
21    Log.exit(
22      chalk`
23      {bold Description}
24        Sign up for a new Expo account
25
26      {bold Usage}
27        $ npx expo register
28
29      Options
30      -h, --help    Output usage information
31    `,
32      0
33    );
34  }
35
36  const { registerAsync } = await import('./registerAsync');
37  return registerAsync().catch(logCmdError);
38};
39