Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project specified with -P or --project is ignored when using init database #3870

Closed
harveylee opened this issue Oct 27, 2021 · 1 comment · Fixed by #3902
Closed

Project specified with -P or --project is ignored when using init database #3870

harveylee opened this issue Oct 27, 2021 · 1 comment · Fixed by #3902
Assignees

Comments

@harveylee
Copy link

harveylee commented Oct 27, 2021

[REQUIRED] Environment info

firebase-tools: 9.21.0

Platform: WSL (Debian buster) on Windows

[REQUIRED] Test case

Create a project directory with two projects and try to initialise the database for the non-default project using firebase init database -P <projectId>. In the below example, assume there is a default project dev and another project test.

[REQUIRED] Steps to reproduce

  1. With dev as the default project, run firebase init database. Database is correctly initialized.
  2. Now run firebase init database -P test. The tool incorrectly initializes database for dev project again, ignoring the specified project. The required API firebasedatabase.googleapis.com is not enabled on the test project.
  3. firebase use --add and set the test project to default alias.
  4. Run firebase init database. The tool correctly initializes database for test project (because it is the default project).

[REQUIRED] Expected behavior

firebase init database -P <projectId> initializes Firebase Realtime Database for the specified project.

[REQUIRED] Actual behavior

firebase init database -P <projectId> initializes Firebase Realtime Database for the default project.

@bkendall
Copy link
Contributor

bkendall commented Nov 3, 2021

Short version: I agree that the parameter should be honored.

I'm not sure what the CLI should do with the init behavior of setting the default project on init (overwriting .firebaserc might be bad), so if you've got thoughts on that that'd be great. Otherwise, I'm thinking about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants