File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 11import * as path from "node:path" ;
2+ import * as url from "node:url" ;
23import { defineCommand , runMain } from "citty" ;
34import { consola } from "consola" ;
45import packageJson from "./package.json" with { type : "json" } ;
@@ -276,23 +277,23 @@ const generateCommand = defineCommand({
276277 if ( args . debug ) consola . level = Number . MAX_SAFE_INTEGER ;
277278 if ( args . silent ) consola . level = 0 ;
278279
279- let customConfig = null ;
280- let customConfigPath : string | undefined ;
280+ let customConfig ;
281281
282282 if ( args [ "custom-config" ] ) {
283283 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 ( ) ;
285287 customConfig = await import ( customConfigPath ) ;
286288 customConfig = customConfig . default || customConfig ;
289+ if ( customConfig ) {
290+ consola . info ( `Found custom config at: ${ customConfigPath } ` ) ;
291+ }
287292 } catch ( error ) {
288293 consola . error ( "Error loading custom config:" , error ) ;
289294 }
290295 }
291296
292- if ( customConfig ) {
293- consola . info ( `Found custom config at: ${ customConfigPath } ` ) ;
294- }
295-
296297 await generateApi ( {
297298 addReadonly : args [ "add-readonly" ] ,
298299 anotherArrayType : args [ "another-array-type" ] ,
You can’t perform that action at this time.
0 commit comments