Skip to content

Commit 333c699

Browse files
committed
fix: simplified the index.ts
1 parent 7ca0607 commit 333c699

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

bin/index.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ import { version } from "../package.json"
1111
import * as util from "../src/utilities/cliUtil"
1212

1313
function handleInitCommand(): Promise<void> {
14-
// eslint-disable-next-line no-async-promise-executor
15-
return new Promise(async (resolve) => {
16-
const editedSam = await util.confirmation()
17-
if (editedSam === "create new SAM project") {
18-
await createSAMCLI()
14+
return new Promise( (resolve) => {
15+
const editedSam = <string>(<unknown>util.confirmation())
16+
if ( editedSam === "create new SAM project") {
17+
createSAMCLI()
1918
} else if (editedSam === "add components to existing SAM") {
20-
await addComponentCLI()
19+
addComponentCLI()
2120
} else if (editedSam === "add modules to existing SAM") {
22-
await addModuleCLI()
21+
addModuleCLI()
2322
}
2423
resolve()
2524
})

src/utilities/cliUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export const inputType = async function (
118118
return takeInput
119119
}
120120

121-
export const confirmation = async function () {
121+
export const confirmation = async function ():Promise<string> {
122122
const r = await inquirer.prompt([
123123
{
124124
type: "rawlist",

0 commit comments

Comments
 (0)