@@ -13,18 +13,34 @@ export default class UpdateCommand extends SchematicCommand {
13
13
public static aliases : string [ ] = [ ] ;
14
14
public readonly scope = CommandScope . inProject ;
15
15
public readonly arguments : string [ ] = [ 'packages' ] ;
16
- public readonly options : Option [ ] = [
16
+ public options : Option [ ] = [
17
17
...this . coreOptions ,
18
18
] ;
19
19
public readonly allowMissingWorkspace = true ;
20
20
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
+
21
39
public async run ( options : UpdateOptions ) {
22
- const collectionName = '@schematics/update' ;
23
- const schematicName = 'update' ;
24
40
25
41
const schematicRunOptions = {
26
- collectionName,
27
- schematicName,
42
+ collectionName : this . collectionName ,
43
+ schematicName : this . schematicName ,
28
44
schematicOptions : options ,
29
45
dryRun : options . dryRun ,
30
46
force : options . force ,
0 commit comments