@@ -22,7 +22,8 @@ async function prompt(options: Omit<PromptObject, 'name'>) {
2222 )
2323
2424 return result . name
25- } catch ( cancelled ) {
25+ }
26+ catch ( cancelled ) {
2627 console . log ( cancelled . message )
2728 process . exit ( 1 )
2829 }
@@ -125,13 +126,15 @@ function processArgs(): Args {
125126 } )
126127
127128 argValues = args . values
128- } catch ( err ) {
129+ }
130+ catch ( err ) {
129131 if ( err . code === 'ERR_PARSE_ARGS_UNKNOWN_OPTION' ) {
130132 console . log ( 'Error:' )
131133 console . log ( err . message )
132134 console . log ( 'See --help for valid options' )
133135 process . exit ( 1 )
134- } else {
136+ }
137+ else {
135138 throw err
136139 }
137140 }
@@ -201,7 +204,8 @@ async function init() {
201204 if ( fs . existsSync ( path . join ( targetDirPath , 'package.json' ) ) ) {
202205 console . log ( 'Target directory already contains package.json' )
203206 }
204- } else {
207+ }
208+ else {
205209 if ( fs . existsSync ( targetDirPath ) ) {
206210 console . log ( 'Target directory already exists' )
207211 }
@@ -399,14 +403,16 @@ function copyFiles(templateFile: string, config: Config) {
399403 }
400404
401405 fs . writeFileSync ( target , content )
402- } else if ( [ 'package.json' , 'vite.config.mts' , 'config.mts' , 'index.md' , 'introduction.md' , 'App.vue' , 'tsconfig.app.json' , 'env.d.ts' ] . includes ( filename ) ) {
406+ }
407+ else if ( [ 'package.json' , 'vite.config.mts' , 'config.mts' , 'index.md' , 'introduction.md' , 'App.vue' , 'tsconfig.app.json' , 'env.d.ts' ] . includes ( filename ) ) {
403408 const template = fs . readFileSync ( templatePath , 'utf-8' )
404409 const content = template
405410 . replace ( / @ p r o j e c t N a m e @ / g, config . mainPackageDirName )
406411 . replace ( new RegExp ( `@(${ Object . keys ( config ) . join ( '|' ) } )@` , 'g' ) , ( all , setting ) => config [ setting ] ?? all )
407412
408413 fs . writeFileSync ( targetPath , content )
409- } else {
414+ }
415+ else {
410416 fs . copyFileSync ( templatePath , targetPath )
411417 }
412418}
0 commit comments