Skip to content

Commit 66d8b0d

Browse files
committed
fix: sonar cloud bugs
1 parent f9702f5 commit 66d8b0d

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

src/roverCLI/roverGenerateCLI.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ export async function addModuleCLI(): Promise<void> {
154154
await rover_addModulesToexisting.addModulesToExistingStack(template)
155155
} else {
156156
template = <IroveraddModule>await createModules(app_name, language)
157+
template["file_name"] = file_name
157158
await rover_addModules.addModules(template)
158159
}
159160
}

src/utilities/cliUtil.ts

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ export const moreStack = async function (message: string) {
340340
return r["stack"]
341341
}
342342

343-
export const params = async function (module: string) {
343+
export const paramss = async function (module: string) {
344344
const choice: Record<string, Array<string> | Array<Iroverdescription>> =
345345
cliConfig.app.choices
346346
let name: Record<string, string> = {}
@@ -397,3 +397,43 @@ export const params = async function (module: string) {
397397
return {}
398398
}
399399
}
400+
401+
export const params=async function(module: string) {
402+
const { choices } = cliConfig.app
403+
const name: Record<string, string> = {}
404+
const res: IroverCLIparamModule = <IroverCLIparamModule>{}
405+
if (module !== "CRUDModule") {
406+
return {}
407+
}
408+
409+
const modulesParams = moduleParams.CRUDModule["params"].params
410+
411+
if (!modulesParams.length) {
412+
return {}
413+
}
414+
415+
for (const param of modulesParams) {
416+
if (param.value === "choice") {
417+
const r = await inputType(
418+
param.key,
419+
<Array<string>>choices[param.key],
420+
param.message
421+
)
422+
Object.assign(res, r)
423+
} else if (param.value === "multichoice") {
424+
const r = await multichoice(param.key, <Array<string>>choices.methods, "")
425+
Object.assign(res, r)
426+
} else if (param.key === "name") {
427+
const r = await inputString(param.key, "", false, param.message)
428+
name[param.key] = r[param.key]
429+
} else {
430+
const r = await inputString(param.key, "", false, param.message)
431+
Object.assign(res, r)
432+
}
433+
}
434+
435+
return {
436+
res,
437+
name: name["name"],
438+
}
439+
}

0 commit comments

Comments
 (0)