From c00dfdc0b744859524f5426232598c7b2b4aa9ac Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Mon, 10 Jun 2019 14:08:57 -0700 Subject: [PATCH] review comment fixes, remove validate function --- src/init/features/project.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/init/features/project.ts b/src/init/features/project.ts index cf34d69f5f1..175e2061638 100644 --- a/src/init/features/project.ts +++ b/src/init/features/project.ts @@ -61,7 +61,6 @@ async function selectProjectFromOptions(options: any): Promise { * @returns A {@link FirebaseProject} object. */ async function selectProjectFromList(options: any): Promise { - let project: FirebaseProject | undefined; const projects: FirebaseProject[] = await listProjects(); let choices = projects.filter((p: FirebaseProject) => !!p).map((p) => { return { @@ -85,18 +84,13 @@ async function selectProjectFromList(options: any): Promise { type: "list", name: "id", message: "Select a default Firebase project for this directory:", - validate: (answer: any) => { - if (!_.includes(choices, answer)) { - return `Must specify a Firebase project to which you have access.`; - } - return true; - }, choices, - } as Question); + }); if (projectId === NEW_PROJECT || projectId === NO_PROJECT) { return { id: projectId }; } + let project: FirebaseProject | undefined; project = projects.find((p) => p.projectId === projectId); const pId = choices.find((p) => p.value === projectId); const label = pId ? pId.name : ""; @@ -131,7 +125,7 @@ export async function doSetup(setup: any, config: Config, options: any): Promise return; } - const projectInfo: ProjectInfo = await getProjectInfo(options); + const projectInfo = await getProjectInfo(options); if (projectInfo.id === NEW_PROJECT) { setup.createProject = true; return;