Skip to content

Commit

Permalink
fix(magic create): removed console.log and reordered options
Browse files Browse the repository at this point in the history
  • Loading branch information
massi-ang authored and bigadsoleiman committed Feb 1, 2024
1 parent 2082862 commit 957dccc
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions cli/magic-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
SupportedRegion,
SupportedSageMakerModels,
SystemConfig,
SupportedBedrockRegion
SupportedBedrockRegion,
} from "../lib/shared/types";
import { LIB_VERSION } from "./version.js";
import * as fs from "fs";
Expand Down Expand Up @@ -120,17 +120,15 @@ async function processCreateOptions(options: any): Promise<void> {
{
type: "confirm",
name: "privateWebsite",
message: "Do you want to deploy a private website? I.e only accessible in VPC",
initial:
options.privateWebsite ||
false,
message:
"Do you want to deploy a private website? I.e only accessible in VPC",
initial: options.privateWebsite || false,
},
{
type: "input",
name: "certificate",
message: "ACM certificate ARN",
initial:
options.certificate,
initial: options.certificate,
skip(): boolean {
return !(this as any).state.answers.privateWebsite;
},
Expand All @@ -139,8 +137,7 @@ async function processCreateOptions(options: any): Promise<void> {
type: "input",
name: "domain",
message: "Domain for private website",
initial:
options.domain,
initial: options.domain,
skip(): boolean {
return !(this as any).state.answers.privateWebsite;
},
Expand Down Expand Up @@ -223,6 +220,15 @@ async function processCreateOptions(options: any): Promise<void> {
},
initial: options.ragsToEnable || [],
},
{
type: "confirm",
name: "kendraEnterprise",
message: "Do you want to enable Kendra Enterprise Edition?",
initial: options.kendraEnterprise || false,
skip(): boolean {
return !(this as any).state.answers.ragsToEnable.includes("kendra");
},
},
{
type: "confirm",
name: "kendra",
Expand All @@ -235,18 +241,8 @@ async function processCreateOptions(options: any): Promise<void> {
return !(this as any).state.answers.enableRag;
},
},
{
type: "confirm",
name: "kendraEnterprise",
message: "Do you want to enable Kendra Enterprise Edition?",
initial: options.kendraEnterprise || false,
skip(): boolean {
return !(this as any).state.answers.ragsToEnable.includes("kendra");
},
},
];
const answers: any = await enquirer.prompt(questions);
console.log(answers);
const kendraExternal = [];
let newKendra = answers.enableRag && answers.kendra;
const existingKendraIndices = Array.from(options.kendraExternal || []);
Expand Down

0 comments on commit 957dccc

Please sign in to comment.