How to use the firebase-tools.setup 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
.then(async (token: string) => {
    const project = await getProject(token);

    showWarning(project);

    const confirmation = await userConfirmation();
    if (!confirmation) {
      console.log('\nYou chose not to continue. Nothing was changed.\n');
      return false;
    }

    console.log('');

    let task = showTask('Downloading project configuration');
    const config = await firebaseTools.setup.web({ project, token });
    task.done('config/project.json');

    // Write config to top-level config directory
    await promisify(writeFile)(
      resolvePath(__dirname, '../../config/project.json'),
      JSON.stringify(config, null, 2)
    );

    // Deploy database rules
    task = showTask('Deploying Firestore indexes and security rules');
    await firebaseTools.deploy({
      project,
      token,
      cwd: resolvePath(__dirname, '../../config')
    });
github firebase / firebase-js-sdk / tools / config.js View on Github external
choices: projects
            .sort(project =>
              project.name.toLowerCase().includes('jscore') ? -1 : 1
            )
            .map(project => ({
              name: `${project.displayName} (${project.projectId})`,
              value: project
            }))
        }
      ]);

      return response.projectId.projectId;
    })();

    // Write config to top-level config directory
    await firebaseTools.setup
      .web({ project, token })
      .then(config =>
        fs.writeFile(
          path.resolve(__dirname, '../config/project.json'),
          JSON.stringify(config, null, 2)
        )
      );

    // npm install the dependencies for functions
    await exec('npm install', {
      cwd: path.resolve(__dirname, '../config/functions')
    });

    // Deploy database rules
    await firebaseTools.deploy({
      project,