-
Notifications
You must be signed in to change notification settings - Fork 918
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
Adding extensions to firebase init #5701
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #5701 +/- ##
==========================================
- Coverage 55.74% 55.73% -0.01%
==========================================
Files 324 324
Lines 21894 21905 +11
Branches 4466 4470 +4
==========================================
+ Hits 12204 12209 +5
- Misses 8609 8616 +7
+ Partials 1081 1080 -1
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
.join("\n\t"); | ||
if ( | ||
!(await confirm({ | ||
message: `firebase.json already contains extensions:\n${currentExtensions}\nWould you like to overwrite them?`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested copy: "firebase.json already contains extensions:\n${currentExtensions}\nThese extensions will be removed from the manifest if you choose to re-initialize. Would you like to overwrite them?"
Just to be extra clear what overwrite means.
return; | ||
} | ||
} | ||
config.set("extensions", {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't delete the .env
files for the extensions. Rather than trying to overwrite it, can we just throw if something already exists to keep things simple?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little awkward as is, but intentional. I'd like init to be idempotent so that it can more safely be used into scripts - init is meant as an interactive command, but some folks still try to use it non interactively.
I considered cleaning up the .env files, with a prompt, only in interactive mode, but leaving them doesn't have any ill effects.
* Adding extensions to firebase init * changelog * Formats
* Adding extensions to firebase init * changelog * Formats
Description
Adds
extensions
as an option tofirebase init
. If selected, this will set up an emptyextensions
section infirebase.json
and create an emptyextensions
directory. If called from a directory that already has extensions set up, it will prompt users if they want to overwrite.Scenarios Tested
![Screenshot 2023-04-17 at 11 28 07 AM](https://user-images.githubusercontent.com/4635763/232580396-6c8caed9-1f6a-4eac-beaa-7fc922a7bfb3.png)
init a fresh directory![Screenshot 2023-04-17 at 11 32 26 AM](https://user-images.githubusercontent.com/4635763/232580440-7c633338-7eb2-4ace-a6c3-8271f2b48c39.png)
init a directory that already has extensions: