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 57
57
"type" : " boolean" ,
58
58
"default" : " true" ,
59
59
"description" : " Disables interactive inputs (i.e., prompts)."
60
+ },
61
+ "defaults" : {
62
+ "type" : " boolean" ,
63
+ "default" : " false" ,
64
+ "description" : " Disables interactive inputs (i.e., prompts) for options with a default."
60
65
}
61
66
}
62
67
}
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ export interface BaseSchematicOptions extends BaseCommandOptions {
53
53
dryRun ?: boolean ;
54
54
force ?: boolean ;
55
55
interactive ?: boolean ;
56
+ defaults ?: boolean ;
56
57
}
57
58
58
59
export interface RunSchematicOptions {
@@ -234,7 +235,11 @@ export abstract class SchematicCommand<
234
235
235
236
this . _engineHost . registerOptionsTransform ( validateOptionsWithSchema ( workflow . registry ) ) ;
236
237
237
- workflow . registry . addPostTransform ( schema . transforms . addUndefinedDefaults ) ;
238
+ if ( options . defaults ) {
239
+ workflow . registry . addPreTransform ( schema . transforms . addUndefinedDefaults ) ;
240
+ } else {
241
+ workflow . registry . addPostTransform ( schema . transforms . addUndefinedDefaults ) ;
242
+ }
238
243
239
244
workflow . registry . addSmartDefaultProvider ( 'projectName' , ( ) => {
240
245
if ( this . _workspace ) {
You can’t perform that action at this time.
0 commit comments