How to use the firebase-tools.list function in firebase-tools

To help you get started, we’ve selected a few firebase-tools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jsayol / FireSQL / tools / test-data / test-setup.ts View on Github external
async function getProject(token: string): Promise {
  if (cliOptions.project) {
    return cliOptions.project;
  }

  const projects = await firebaseTools.list({ token });
  const { project } = await inquirer.prompt([
    {
      type: 'list',
      name: 'project',
      message: 'Which project would you like to use to test?',
      choices: projects.map((project: { [k: string]: string }) => ({
        name: chalk`${project.name} {grey (${project.id})}`,
        value: project
      }))
    }
  ]);

  return project.id;
}