-
Notifications
You must be signed in to change notification settings - Fork 1.1k
redirect to init apphosting for webframeworks on init hosting #9887
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
base: jh-remove-wf
Are you sure you want to change the base?
Changes from 4 commits
73d83f6
fd64729
7e50b5e
cc05c02
bbbee83
c7d00ea
bfe48fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| import * as clc from "colorette"; | ||
| import { join } from "path"; | ||
| import { Client } from "../../../apiv2"; | ||
| import { discover, WebFrameworks } from "../../../frameworks"; | ||
| import * as github from "./github"; | ||
| import { confirm, input } from "../../../prompt"; | ||
| import { logger } from "../../../logger"; | ||
|
|
@@ -30,6 +31,9 @@ export async function askQuestions(setup: Setup, config: Config, options: Option | |
| setup.featureInfo = setup.featureInfo || {}; | ||
| setup.featureInfo.hosting = {}; | ||
|
|
||
| // Fire off framework detection concurrently so it runs while the site check happens | ||
| const discoverPromise = discover(config.projectDir, false); | ||
|
|
||
| // There's a path where we can set up Hosting without a project, so if | ||
| // if setup.projectId is empty, we don't do any checking for a Hosting site. | ||
| if (setup.projectId) { | ||
|
|
@@ -58,6 +62,15 @@ export async function askQuestions(setup: Setup, config: Config, options: Option | |
| } | ||
| } | ||
|
|
||
| const discoveredFramework = await discoverPromise; | ||
| if (discoveredFramework && discoveredFramework.mayWantBackend) { | ||
| const frameworkName = | ||
| WebFrameworks[discoveredFramework.framework]?.name ?? discoveredFramework.framework; | ||
| throw new FirebaseError( | ||
| `Detected a ${frameworkName} codebase. Use ${clc.bold("firebase init apphosting")} instead.`, | ||
|
||
| ); | ||
| } | ||
|
|
||
| logger.info(); | ||
| logger.info( | ||
| `Your ${clc.bold("public")} directory is the folder (relative to your project directory) that`, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.