@@ -404,26 +404,25 @@ function createApp(
404
404
interactive : boolean ,
405
405
defaultBase : string
406
406
) {
407
- // creating the app itself
408
- const args = [
409
- name ,
410
- ...process . argv
411
- . slice ( parsedArgs . _ [ 2 ] ? 3 : 2 )
412
- . filter (
413
- ( a ) =>
414
- ! a . startsWith ( '--cli' ) &&
415
- ! a . startsWith ( '--preset' ) &&
416
- ! a . startsWith ( '--appName' ) &&
417
- ! a . startsWith ( '--app-name' ) &&
418
- ! a . startsWith ( '--style' ) &&
419
- ! a . startsWith ( '--nxCloud' ) &&
420
- ! a . startsWith ( '--nx-cloud' ) &&
421
- ! a . startsWith ( '--interactive' ) &&
422
- ! a . startsWith ( '--defaultBase' ) &&
423
- ! a . startsWith ( '--default-base' )
424
- ) // not used by the new command
425
- . map ( ( a ) => `"${ a } "` ) ,
426
- ] . join ( ' ' ) ;
407
+ const filterArgs = [
408
+ '_' ,
409
+ 'app-name' ,
410
+ 'appName' ,
411
+ 'cli' ,
412
+ 'default-base' ,
413
+ 'defaultBase' ,
414
+ 'interactive' ,
415
+ 'nx-cloud' ,
416
+ 'nxCloud' ,
417
+ 'preset' ,
418
+ 'style' ,
419
+ ] ;
420
+
421
+ // These are the arguments that are passed to the schematic
422
+ const args = Object . keys ( parsedArgs )
423
+ . filter ( ( key ) => ! filterArgs . includes ( key ) )
424
+ . map ( ( key ) => `--${ key } =${ parsedArgs [ key ] } ` )
425
+ . join ( ' ' ) ;
427
426
428
427
const appNameArg = appName ? ` --appName="${ appName } "` : `` ;
429
428
const styleArg = style ? ` --style="${ style } "` : `` ;
@@ -434,7 +433,7 @@ function createApp(
434
433
const defaultBaseArg = defaultBase ? ` --defaultBase="${ defaultBase } "` : `` ;
435
434
436
435
console . log (
437
- `new ${ args } --preset="${ preset } "${ appNameArg } ${ styleArg } ${ nxCloudArg } ${ interactiveArg } ${ defaultBaseArg } --collection=@nrwl/workspace`
436
+ `new ${ name } ${ args } --preset="${ preset } "${ appNameArg } ${ styleArg } ${ nxCloudArg } ${ interactiveArg } ${ defaultBaseArg } --collection=@nrwl/workspace`
438
437
) ;
439
438
const executablePath = path . join ( tmpDir , 'node_modules' , '.bin' , cli . command ) ;
440
439
const collectionJsonPath = path . join (
@@ -445,7 +444,7 @@ function createApp(
445
444
'collection.json'
446
445
) ;
447
446
execSync (
448
- `"${ executablePath } " new ${ args } --preset="${ preset } "${ appNameArg } ${ styleArg } ${ nxCloudArg } ${ interactiveArg } ${ defaultBaseArg } --collection=${ collectionJsonPath } ` ,
447
+ `"${ executablePath } " new ${ name } ${ args } --preset="${ preset } "${ appNameArg } ${ styleArg } ${ nxCloudArg } ${ interactiveArg } ${ defaultBaseArg } --collection=${ collectionJsonPath } ` ,
449
448
{
450
449
stdio : [ 0 , 1 , 2 ] ,
451
450
}
0 commit comments