@@ -13,18 +13,34 @@ export default class UpdateCommand extends SchematicCommand {
1313 public static aliases : string [ ] = [ ] ;
1414 public readonly scope = CommandScope . inProject ;
1515 public readonly arguments : string [ ] = [ 'packages' ] ;
16- public readonly options : Option [ ] = [
16+ public options : Option [ ] = [
1717 ...this . coreOptions ,
1818 ] ;
1919 public readonly allowMissingWorkspace = true ;
2020
21+ private collectionName = '@schematics/update' ;
22+ private schematicName = 'update' ;
23+
24+ private initialized = false ;
25+ public async initialize ( options : any ) {
26+ if ( this . initialized ) {
27+ return ;
28+ }
29+ super . initialize ( options ) ;
30+ this . initialized = true ;
31+
32+ const availableOptions : Option [ ] = await this . getOptions ( {
33+ schematicName : this . schematicName ,
34+ collectionName : this . collectionName ,
35+ } ) ;
36+ this . options = this . options . concat ( availableOptions || [ ] ) ;
37+ }
38+
2139 public async run ( options : UpdateOptions ) {
22- const collectionName = '@schematics/update' ;
23- const schematicName = 'update' ;
2440
2541 const schematicRunOptions = {
26- collectionName,
27- schematicName,
42+ collectionName : this . collectionName ,
43+ schematicName : this . schematicName ,
2844 schematicOptions : options ,
2945 dryRun : options . dryRun ,
3046 force : options . force ,
0 commit comments