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 {
3737 private _host = new NodeJsSyncHost ( ) ;
3838 private _workspace : experimental . workspace . Workspace ;
3939 private _deAliasedName : string ;
40+ private _originalOptions : Option [ ] ;
4041 argStrategy = ArgumentStrategy . Nothing ;
4142
4243 protected readonly coreOptions : Option [ ] = [
@@ -169,13 +170,22 @@ export abstract class SchematicCommand extends Command {
169170
170171 protected removeCoreOptions ( options : any ) : any {
171172 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+ }
175182 return opts ;
176183 }
177184
178185 protected getOptions ( options : GetOptionsOptions ) : Promise < GetOptionsResult > {
186+ // Make a copy.
187+ this . _originalOptions = [ ...this . options ] ;
188+
179189 // TODO: get default collectionName
180190 const collectionName = options . collectionName || '@schematics/angular' ;
181191
You can’t perform that action at this time.
0 commit comments