Skip to content

Commit 9d245fe

Browse files
committed
fix: removed the unwanted codes
1 parent d6cc357 commit 9d245fe

File tree

2 files changed

+0
-127
lines changed

2 files changed

+0
-127
lines changed

src/roverCLI/roverGenerateCLI.ts

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -90,74 +90,6 @@ export async function addComponentCLI() {
9090
} while (moreStacks !== "No")
9191
await rover_addComponent.addComponents(template)
9292
}
93-
export async function addModuleCLIs(): Promise<void> {
94-
const res = await roverADD()
95-
let template: IroveraddModule = <IroveraddModule>{}
96-
const appName = res["appName"]
97-
const language = res["language"]
98-
const fileName = res["filename"]
99-
const addToExisting = await util.multichoice(
100-
"addToExisting",
101-
["Yes", "No"],
102-
"Do you want to Add a module to existing Module :"
103-
)
104-
if (addToExisting.addToExisting[0] == "Yes") {
105-
const CompStacks = await roverHelpers.checkNested(fileName)
106-
const choice = Object.keys(CompStacks["compStacks"])
107-
let i = 0
108-
do {
109-
const nested = CompStacks["checkNested"]
110-
if (nested) {
111-
const chooseStack = await util.inputType(
112-
"Select the stack to which you want to add the module ",
113-
choice
114-
)
115-
const selectedChoice = choice.filter((ele) =>
116-
Object.values(chooseStack).includes(ele)
117-
)
118-
// const samResources = roverHelpers.listSAMResources(
119-
// fileName,
120-
// selectedChoice[0]
121-
// )
122-
const moduletemplate = <IroveraddModule>(
123-
await createModules(appName, language)
124-
)
125-
Object.keys(moduletemplate.stackDetails).forEach((ele) => {
126-
moduletemplate.stackDetails[ele].stackName = selectedChoice[0]
127-
})
128-
if (Object.keys(template).length == 0) {
129-
template = moduletemplate
130-
} else {
131-
template.stackDetails = {
132-
...template.stackDetails,
133-
...moduletemplate.stackDetails,
134-
}
135-
}
136-
} else {
137-
const choice = cliConfig.customizable.components
138-
const Compnents = <Array<string>>(
139-
await util.multichoice("components", choice, "")
140-
)
141-
template = { ...appName, language }
142-
if (customStacks !== null)
143-
template = {
144-
...template,
145-
...Compnents,
146-
}
147-
}
148-
moreStacks = await util.choicesYorN(
149-
"Do you want to add one more modules to another stack ?"
150-
)
151-
i = i + 1
152-
} while (moreStacks !== "No")
153-
template["fileName"] = fileName
154-
await rover_addModulesToexisting.addModulesToExistingStack(template)
155-
} else {
156-
template = <IroveraddModule>await createModules(appName, language)
157-
template["fileName"] = fileName
158-
await rover_addModules.addModules(template)
159-
}
160-
}
16193
export async function addModuleCLI(): Promise<void> {
16294
const res = await roverADD()
16395
let template: IroveraddModule = <IroveraddModule>{}

src/utilities/cliUtil.ts

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -339,65 +339,6 @@ export const choicesYorN = async function (message: string) {
339339
])
340340
return r["stack"]
341341
}
342-
343-
export const paramss = async function (module: string) {
344-
const choice: Record<string, Array<string> | Array<Iroverdescription>> =
345-
cliConfig.app.choices
346-
let name: Record<string, string> = {}
347-
let res: IroverCLIparamModule = <IroverCLIparamModule>{}
348-
if (module === "CRUDModule") {
349-
const modulesParams = moduleParams.CRUDModule["params"].params
350-
const paramslength = modulesParams.length
351-
352-
if (paramslength > 0) {
353-
for (let i = 0; i < paramslength; i++) {
354-
if (modulesParams[i].value === "choice") {
355-
const r = await inputType(
356-
modulesParams[i].key,
357-
<Array<string>>choice[modulesParams[i].key],
358-
modulesParams[i].message
359-
)
360-
361-
res = { ...res, ...r }
362-
} else if (modulesParams[i].value === "multichoice") {
363-
const r = await multichoice(
364-
modulesParams[i].key,
365-
<Array<string>>choice.methods,
366-
""
367-
)
368-
res = { ...res, ...r }
369-
} else {
370-
if (modulesParams[i].key === "name") {
371-
const r = await inputString(
372-
"name",
373-
"",
374-
false,
375-
modulesParams[i].message
376-
)
377-
name = r
378-
} else {
379-
const r = await inputString(
380-
modulesParams[i].key,
381-
"",
382-
false,
383-
modulesParams[i].message
384-
)
385-
res = { ...res, ...r }
386-
}
387-
}
388-
}
389-
return {
390-
res,
391-
name: name["name"],
392-
}
393-
} else {
394-
return {}
395-
}
396-
} else {
397-
return {}
398-
}
399-
}
400-
401342
export const params = async function (module: string) {
402343
const { choices } = cliConfig.app
403344
const name: Record<string, string> = {}

0 commit comments

Comments
 (0)