File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 54
54
"type" : " boolean" ,
55
55
"default" : " true" ,
56
56
"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."
57
62
}
58
63
}
59
64
}
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ export interface BaseSchematicSchema {
56
56
dryRun ?: boolean ;
57
57
force ?: boolean ;
58
58
interactive ?: boolean ;
59
+ defaults ?: boolean ;
59
60
}
60
61
61
62
export interface RunSchematicOptions extends BaseSchematicSchema {
@@ -262,7 +263,11 @@ export abstract class SchematicCommand<
262
263
263
264
this . _engineHost . registerOptionsTransform ( validateOptionsWithSchema ( workflow . registry ) ) ;
264
265
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
+ }
266
271
267
272
workflow . registry . addSmartDefaultProvider ( 'projectName' , ( ) => {
268
273
if ( this . _workspace ) {
You can’t perform that action at this time.
0 commit comments