@@ -378,20 +378,24 @@ const absolutePathToDestDir = (argv) => {
378
378
return path . resolve ( process . cwd ( ) , relativeDestDir )
379
379
}
380
380
381
- const argv = parseCommandLineArgs ( process . argv . slice ( 2 ) )
381
+ const main = ( argv ) => {
382
+ const config = loadConfig ( endpointsFile )
382
383
383
- const config = loadConfig ( endpointsFile )
384
+ const destDir = absolutePathToDestDir ( argv )
385
+ console . log ( 'Destination directory:' , destDir )
384
386
385
- const destDir = absolutePathToDestDir ( argv )
386
- console . log ( 'Destination directory:' , destDir )
387
+ if ( ! fs . existsSync ( destDir ) ) {
388
+ console . log ( 'Create' , destDir )
389
+ fs . mkdirSync ( destDir , { recursive : true } )
390
+ }
387
391
388
- if ( ! fs . existsSync ( destDir ) ) {
389
- console . log ( 'Create' , destDir )
390
- fs . mkdirSync ( destDir , { recursive : true } )
392
+ createApp ( destDir , argv )
393
+ createDb ( destDir , argv )
394
+ createEndpoints ( destDir , argv , config )
395
+ createDependenciesDescriptor ( destDir , argv )
396
+ showInstructions ( argv . lang )
391
397
}
392
398
393
- createApp ( destDir , argv )
394
- createDb ( destDir , argv )
395
- createEndpoints ( destDir , argv , config )
396
- createDependenciesDescriptor ( destDir , argv )
397
- showInstructions ( argv . lang )
399
+
400
+ const argv = parseCommandLineArgs ( process . argv . slice ( 2 ) )
401
+ main ( argv )
0 commit comments