Skip to content

Commit 2d5bf9f

Browse files
committed
feature: added chatgpt support
1 parent f5b7931 commit 2d5bf9f

File tree

1 file changed

+0
-113
lines changed

1 file changed

+0
-113
lines changed

src/utilities/cliUtil.ts

Lines changed: 0 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -212,119 +212,6 @@ export const password = async function (name: string, message = "") {
212212
return r
213213
}
214214

215-
export const samBuilds = async function (lang: string) {
216-
try {
217-
const obj = buildConfig.samConfig
218-
const choices = <Record<string, Array<string>>>buildConfig.samConfig.choices
219-
const subObj = <Array<Record<string, string>>>buildConfig.samConfig.samBuild
220-
let sam: Record<string, Record<string, string>> = await inputCli(
221-
obj,
222-
subObj,
223-
""
224-
)
225-
const temp: Record<string, Record<string, string>> = {}
226-
Object.values(sam).forEach((ele) => {
227-
Object.assign(temp, ele)
228-
})
229-
sam = temp
230-
const langs = { language: lang }
231-
const no_of_env = await inputNumber("no_of_env", "environments")
232-
const envs: string[] = []
233-
let steps: Record<string, Array<string>> = {}
234-
let stacknames: Record<string, string> = {}
235-
const deploymentregion: Record<string, string> = {}
236-
let deploymentparameters: Record<string, string> = {}
237-
let depBucketNames: Record<string, string> = {}
238-
239-
const branches = { branches: ["main"] }
240-
for (let i = 1; i <= no_of_env; i++) {
241-
const env = await inputString(`env${i}`, "", false, `Envrionment ${i} :`)
242-
const envName = env[`env${i}`]
243-
envs.push(envName)
244-
245-
const stepsChoice = choices.dev
246-
let step = await multichoice(
247-
`steps required for ${envName} environment `,
248-
stepsChoice,
249-
""
250-
)
251-
const steps1: Record<string, Array<string>> = {}
252-
step = Object.keys(step).map((ele) => {
253-
let name: string = ele.replace("steps required for ", "")
254-
name = name.replace(" environment ", "")
255-
steps1[name] = step[ele]
256-
})
257-
258-
const stackname = await inputString(
259-
`${envName}`,
260-
"",
261-
true,
262-
263-
`Stack Name(optional) --> ${envName} :`
264-
)
265-
const deploymentbucket = await inputString(
266-
`${envName}`,
267-
"",
268-
true,
269-
`Deployment Bucket(optional) --> ${envName} :`
270-
)
271-
const regionChoice = choices.deploymentregion
272-
const deployment_region = await inputType(
273-
`${envName}`,
274-
regionChoice,
275-
"Deployment Region"
276-
)
277-
const deployment_parameter = await inputString(
278-
`${envName}`,
279-
"",
280-
true,
281-
`Deployment Parameter(optional) --> ${envName} :`
282-
)
283-
steps = { ...steps, ...steps1 }
284-
285-
stacknames = { ...stacknames, ...stackname }
286-
287-
depBucketNames = {
288-
...depBucketNames,
289-
...deploymentbucket,
290-
}
291-
deploymentregion[`${envName}`] = deployment_region[`${envName}`]
292-
deploymentparameters = {
293-
...deploymentparameters,
294-
...deployment_parameter,
295-
}
296-
}
297-
298-
const deployment_choice = choices.deployment
299-
const deploymentEvent = await multichoice(
300-
`deploymentevents`,
301-
deployment_choice,
302-
""
303-
)
304-
const framework = { framework: "sam" }
305-
306-
const result: IroverDeploymentObject = {
307-
...sam,
308-
...langs,
309-
no_of_env,
310-
envs,
311-
...branches,
312-
...framework,
313-
steps,
314-
stackname: { ...stacknames },
315-
deploymentbucket: {
316-
...depBucketNames,
317-
},
318-
deploymentregion,
319-
deploymentparameters,
320-
...deploymentEvent,
321-
}
322-
return result
323-
} catch (error) {
324-
console.log(error)
325-
}
326-
}
327-
328215
export const samBuild = async (lang: string) => {
329216
try {
330217
const { samConfig } = buildConfig

0 commit comments

Comments
 (0)