Skip to content

Commit 943c260

Browse files
committed
chore: update exit cli
1 parent 9887f65 commit 943c260

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "swagger-typescript-api-es",
3-
"version": "0.0.10",
3+
"version": "0.0.11",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.mjs",

src/cli-start.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,21 +118,21 @@ cli
118118

119119
export function startCli() {
120120
try {
121-
cli.command('').action((args) => {
121+
cli.command('').action(async (args) => {
122122
let optionsConfig = args;
123123

124124
optionsConfig =
125125
Object.keys(optionsConfig).length <= 1
126126
? readConfig(FILE_NAME_CONFIG)
127127
: formatOptions(optionsConfig);
128128

129-
generateApi(optionsConfig);
129+
await generateApi(optionsConfig);
130+
131+
// eslint-disable-next-line unicorn/no-process-exit
132+
process.exit(0);
130133
});
131134

132135
cli.parse();
133-
134-
// eslint-disable-next-line unicorn/no-process-exit
135-
process.exit(0);
136136
} catch (error: any) {
137137
console.log(pc.red('❌ SWAGGER-TYPESCRIPT-API error: ' + error.message));
138138

0 commit comments

Comments
 (0)