File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
packages/@angular/cli/models Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ export abstract class SchematicCommand extends Command {
37
37
private _host = new NodeJsSyncHost ( ) ;
38
38
private _workspace : experimental . workspace . Workspace ;
39
39
private _deAliasedName : string ;
40
+ private _originalOptions : Option [ ] ;
40
41
argStrategy = ArgumentStrategy . Nothing ;
41
42
42
43
protected readonly coreOptions : Option [ ] = [
@@ -169,13 +170,22 @@ export abstract class SchematicCommand extends Command {
169
170
170
171
protected removeCoreOptions ( options : any ) : any {
171
172
const opts = Object . assign ( { } , options ) ;
172
- delete opts . dryRun ;
173
- delete opts . force ;
174
- delete opts . debug ;
173
+ if ( this . _originalOptions . find ( option => option . name == 'dryRun' ) ) {
174
+ delete opts . dryRun ;
175
+ }
176
+ if ( this . _originalOptions . find ( option => option . name == 'force' ) ) {
177
+ delete opts . force ;
178
+ }
179
+ if ( this . _originalOptions . find ( option => option . name == 'debug' ) ) {
180
+ delete opts . debug ;
181
+ }
175
182
return opts ;
176
183
}
177
184
178
185
protected getOptions ( options : GetOptionsOptions ) : Promise < GetOptionsResult > {
186
+ // Make a copy.
187
+ this . _originalOptions = [ ...this . options ] ;
188
+
179
189
// TODO: get default collectionName
180
190
const collectionName = options . collectionName || '@schematics/angular' ;
181
191
You can’t perform that action at this time.
0 commit comments