File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
33import { resolve } from "node:path" ;
4+ import { pathToFileURL } from "node:url" ;
45import { cli } from "./cli/index.js" ;
56import packageJson from "./package.json" ;
67import { TemplatesGenConfig } from "./src/commands/generate-templates/configuration.js" ;
@@ -295,20 +296,21 @@ program.addCommand({
295296const main = async ( ) => {
296297 const { command, options } = await program . execute ( { args : process . argv } ) ;
297298
298- let customConfig = null ;
299- let customConfigPath ;
299+ let customConfig ;
300300
301301 if ( options . customConfig ) {
302302 try {
303- customConfigPath = resolve ( process . cwd ( ) , options . customConfig ) ;
303+ const customConfigPath = pathToFileURL (
304+ resolve ( process . cwd ( ) , options . customConfig ) ,
305+ ) . toString ( ) ;
304306 customConfig = await import ( customConfigPath ) ;
305307 customConfig = customConfig . default || customConfig ;
308+ if ( customConfig ) {
309+ console . log ( `✨ found custom config at: ${ customConfigPath } ` ) ;
310+ }
306311 } catch ( e ) {
307312 console . error ( "Error loading custom config" , e ) ;
308313 }
309- if ( customConfig ) {
310- console . log ( `✨ found custom config at: ${ customConfigPath } ` ) ;
311- }
312314 }
313315
314316 try {
You can’t perform that action at this time.
0 commit comments