Skip to content

Commit a5a619f

Browse files
aalejjoehan
andauthored
Fixed issue where firebase init hosting re-prompts for source (#8617)
* Fixed issue where firebase init hosting re-prompts for source * Simplify and correct condition for determining when to prompt --------- Co-authored-by: joehan <[email protected]>
1 parent 2327584 commit a5a619f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
- Fixed issue where, with `webframeworks` enabled, `firebase init hosting` re-prompts users for source. (#8587)
12
- Update typescript version in functions template to avoid build issue with @google-cloud/storage depedency (#8194)

src/init/features/hosting/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export async function doSetup(setup: any, config: any, options: Options): Promis
6666
if (experiments.isEnabled("webframeworks")) {
6767
if (discoveredFramework) {
6868
const name = WebFrameworks[discoveredFramework.framework].name;
69-
setup.hosting.useDiscoveredFramework = await confirm({
69+
setup.hosting.useDiscoveredFramework ??= await confirm({
7070
message: `Detected an existing ${name} codebase in the current directory, should we use this?`,
7171
default: true,
7272
});
@@ -82,7 +82,7 @@ export async function doSetup(setup: any, config: any, options: Options): Promis
8282
}
8383

8484
if (setup.hosting.useWebFrameworks) {
85-
setup.hosting.source = await input({
85+
setup.hosting.source ??= await input({
8686
message: "What folder would you like to use for your web application's root directory?",
8787
default: "hosting",
8888
});
@@ -92,7 +92,7 @@ export async function doSetup(setup: any, config: any, options: Options): Promis
9292

9393
if (discoveredFramework) {
9494
const name = WebFrameworks[discoveredFramework.framework].name;
95-
setup.hosting.useDiscoveredFramework = await confirm({
95+
setup.hosting.useDiscoveredFramework ??= await confirm({
9696
message: `Detected an existing ${name} codebase in ${setup.hosting.source}, should we use this?`,
9797
default: true,
9898
});

0 commit comments

Comments
 (0)