File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 5454 "type" : " boolean" ,
5555 "default" : " true" ,
5656 "description" : " Disables interactive inputs (i.e., prompts)."
57+ },
58+ "defaults" : {
59+ "type" : " boolean" ,
60+ "default" : " false" ,
61+ "description" : " Disables interactive inputs (i.e., prompts) for options with a default."
5762 }
5863 }
5964 }
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ export interface BaseSchematicSchema {
5656 dryRun ?: boolean ;
5757 force ?: boolean ;
5858 interactive ?: boolean ;
59+ defaults ?: boolean ;
5960}
6061
6162export interface RunSchematicOptions extends BaseSchematicSchema {
@@ -262,7 +263,11 @@ export abstract class SchematicCommand<
262263
263264 this . _engineHost . registerOptionsTransform ( validateOptionsWithSchema ( workflow . registry ) ) ;
264265
265- workflow . registry . addPostTransform ( schema . transforms . addUndefinedDefaults ) ;
266+ if ( options . defaults ) {
267+ workflow . registry . addPreTransform ( schema . transforms . addUndefinedDefaults ) ;
268+ } else {
269+ workflow . registry . addPostTransform ( schema . transforms . addUndefinedDefaults ) ;
270+ }
266271
267272 workflow . registry . addSmartDefaultProvider ( 'projectName' , ( ) => {
268273 if ( this . _workspace ) {
You can’t perform that action at this time.
0 commit comments