66 * found in the LICENSE file at https://angular.io/license
77 */
88
9- // tslint:disable:no-global-tslint-disable no-any
109import { terminal } from '@angular-devkit/core' ;
1110import { Arguments , SubCommandDescription } from '../models/interface' ;
1211import { SchematicCommand } from '../models/schematic-command' ;
@@ -18,10 +17,12 @@ export class GenerateCommand extends SchematicCommand<GenerateCommandSchema> {
1817 longSchematicName : string | undefined ;
1918
2019 async initialize ( options : GenerateCommandSchema & Arguments ) {
21- await super . initialize ( options ) ;
22-
2320 // Fill up the schematics property of the command description.
2421 const [ collectionName , schematicName ] = this . parseSchematicInfo ( options ) ;
22+ this . collectionName = collectionName ;
23+ this . schematicName = schematicName ;
24+
25+ await super . initialize ( options ) ;
2526
2627 const collection = this . getCollection ( collectionName ) ;
2728 const subcommands : { [ name : string ] : SubCommandDescription } = { } ;
@@ -60,15 +61,13 @@ export class GenerateCommand extends SchematicCommand<GenerateCommandSchema> {
6061 }
6162
6263 public async run ( options : GenerateCommandSchema & Arguments ) {
63- const [ collectionName , schematicName ] = this . parseSchematicInfo ( options ) ;
64-
65- if ( ! schematicName || ! collectionName ) {
64+ if ( ! this . schematicName || ! this . collectionName ) {
6665 return this . printHelp ( options ) ;
6766 }
6867
6968 return this . runSchematic ( {
70- collectionName,
71- schematicName,
69+ collectionName : this . collectionName ,
70+ schematicName : this . schematicName ,
7271 schematicOptions : options [ '--' ] || [ ] ,
7372 debug : ! ! options . debug || false ,
7473 dryRun : ! ! options . dryRun || false ,
0 commit comments