-
Notifications
You must be signed in to change notification settings - Fork 934
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
firebase use --alias is in conflict with commander #1457
Comments
This issue does not seem to follow the issue template. Make sure you provide all the required information. |
@sferencik thanks for the detailed report! |
Huh. I am making a note to myself to take a look. Thanks b/137017467 |
@samedson I have the same problem. It seems that the bug is not resolved yet. |
@samtstern It's been more than a year since this issue has been opened but seems like this bug still exists. |
+1 also having this issue. Is there another way to create aliases using the CLI that don't involve using the interactive tool? Basically I want to be able to script this alias creation in my firebase project. Update: I guess anyone is now currently using a .firebaserc file with projects in it when sharing across dev teams:
|
Seems like this is: It was fixed in Commander 7, as described here: Right now we're only using Commander 4 so we'd have to upgrade 3 major versions to get the fix. Not too hard, but also a bit scary. |
Just bumped into this too. Not a big deal to write a small script to modify .firebaserc directly... but for what it's worth: |
Running
firebase use --alias
, I get an error:I believe the
--alias
option is in conflict with commander, which firebase uses for parsing the command-line. Commander has a feature called command aliases (so you could alias e.g.firebase set
tofirebase use
) and as it tries to evaluate the aliases, it gets confused by the--alias
option. If my assessment is correct, it's not possible to have an option named--alias
(without a change in commander).I briefly looked at the commander code, and what happens is this:
init
,deploy
, etc.), each represented by aCommand
objectCommand
class has a method calledalias()
- more on that laterfirebase use --alias myAlias --debug myProjectId
, the commander willuse
) and create aCommand
object, setting._name = "use"
.alias = "myAlias"
and.debug = true
.alias
field above has overwritten the.alias()
methodCommand("use")
, it tries to invoke its.alias()
method but it's gone - there's now an.alias
field instead, courtesy to us using the--alias
optionIt makes me wonder why no-one else has encountered this before?
Is there an alternative to using
--alias
? I would be OK with--add
, but I need to run this on the CI.Environment info
firebase-tools: 7.0.2
commander: 2.20.0
Platform: Windows 10
Debug stack-trace
The text was updated successfully, but these errors were encountered: