Skip to content

Commit c3384d7

Browse files
authored
Update index.js
1 parent dbcf6cc commit c3384d7

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

index.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@ const program = cli({
207207
description: "extract all enums from inline interface\\type content to typescript enum construction",
208208
default: codeGenBaseConfig.extractEnums,
209209
},
210+
{
211+
flags: "--custom-config <string>",
212+
description: "custom config: primitiveTypeConstructs, hooks, ... ",
213+
default: '',
214+
},
210215
],
211216
});
212217

@@ -249,13 +254,26 @@ program.addCommand({
249254
],
250255
});
251256

252-
const main = async () => {
253-
const { command, options } = await program.execute({ args: process.argv });
257+
const getCustomConfig = () => {
258+
259+
}
254260

261+
const main = async () => {
262+
const { command, options } = await program.execute({ args: process.argv });
263+
let customConfig = null
264+
try {
265+
if (options.customConfig) {
266+
const customConfigPath = resolve(process.cwd(), options.customConfig)
267+
customConfig = require(customConfigPath)
268+
}
269+
} catch (error) {
270+
}
271+
console.log(customConfig)
255272
try {
256273
switch (command) {
257274
case null: {
258275
await generateApi({
276+
...customConfig,
259277
name: options.name,
260278
url: options.path,
261279
generateRouteTypes: options.routeTypes,

0 commit comments

Comments
 (0)