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

Fix emulator configuration warnings #2292

Merged
merged 3 commits into from
May 27, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix emulator configuration warnings
  • Loading branch information
samtstern committed May 26, 2020
commit eb8f21ca47b6a16b4f605cd0623c9dad78f98715
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixes incorrect warning about emulator configuration (#2290).
12 changes: 9 additions & 3 deletions src/emulator/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ export function shouldStart(options: any, name: Emulators): boolean {
return !!options.project;
}
const targets = filterEmulatorTargets(options);
const emulatorInTargets = targets.indexOf(name) >= 0;

if (name === Emulators.UI) {
if (options.config.get("emulators.ui.enabled") === false) {
// Allow disabling UI via `{emulators: {"ui": {"enabled": false}}}`.
Expand All @@ -168,7 +170,11 @@ export function shouldStart(options: any, name: Emulators): boolean {
}

// Don't start the functions emulator if we can't find the source directory
if (name === Emulators.FUNCTIONS && !options.config.get("functions.source")) {
if (
name === Emulators.FUNCTIONS &&
emulatorInTargets &&
!options.config.get("functions.source")
) {
EmulatorLogger.forEmulator(Emulators.FUNCTIONS).logLabeled(
"WARN",
"functions",
Expand All @@ -179,7 +185,7 @@ export function shouldStart(options: any, name: Emulators): boolean {
return false;
}

if (name === Emulators.HOSTING && !options.config.get("hosting")) {
if (name === Emulators.HOSTING && emulatorInTargets && !options.config.get("hosting")) {
EmulatorLogger.forEmulator(Emulators.HOSTING).logLabeled(
"WARN",
"hosting",
Expand All @@ -190,7 +196,7 @@ export function shouldStart(options: any, name: Emulators): boolean {
return false;
}

return targets.indexOf(name) >= 0;
return emulatorInTargets;
}

export async function startAll(options: any, noUi: boolean = false): Promise<void> {
Expand Down