File tree 1 file changed +8
-7
lines changed
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 1
1
import * as path from "node:path" ;
2
+ import * as url from "node:url" ;
2
3
import { defineCommand , runMain } from "citty" ;
3
4
import { consola } from "consola" ;
4
5
import packageJson from "./package.json" with { type : "json" } ;
@@ -276,23 +277,23 @@ const generateCommand = defineCommand({
276
277
if ( args . debug ) consola . level = Number . MAX_SAFE_INTEGER ;
277
278
if ( args . silent ) consola . level = 0 ;
278
279
279
- let customConfig = null ;
280
- let customConfigPath : string | undefined ;
280
+ let customConfig ;
281
281
282
282
if ( args [ "custom-config" ] ) {
283
283
try {
284
- customConfigPath = path . resolve ( process . cwd ( ) , args [ "custom-config" ] ) ;
284
+ const customConfigPath = url
285
+ . pathToFileURL ( path . resolve ( process . cwd ( ) , args [ "custom-config" ] ) )
286
+ . toString ( ) ;
285
287
customConfig = await import ( customConfigPath ) ;
286
288
customConfig = customConfig . default || customConfig ;
289
+ if ( customConfig ) {
290
+ consola . info ( `Found custom config at: ${ customConfigPath } ` ) ;
291
+ }
287
292
} catch ( error ) {
288
293
consola . error ( "Error loading custom config:" , error ) ;
289
294
}
290
295
}
291
296
292
- if ( customConfig ) {
293
- consola . info ( `Found custom config at: ${ customConfigPath } ` ) ;
294
- }
295
-
296
297
await generateApi ( {
297
298
addReadonly : args [ "add-readonly" ] ,
298
299
anotherArrayType : args [ "another-array-type" ] ,
You can’t perform that action at this time.
0 commit comments