File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
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 {
@@ -259,6 +260,11 @@ export abstract class SchematicCommand<
259
260
} ) ;
260
261
261
262
if ( options . interactive !== false && process . stdout . isTTY ) {
263
+ if ( options . defaults ) {
264
+ ( workflow . registry as schema . CoreSchemaRegistry )
265
+ . addPreTransform ( schema . transforms . addUndefinedDefaults ) ;
266
+ }
267
+
262
268
workflow . registry . usePromptProvider ( ( definitions : Array < schema . PromptDefinition > ) => {
263
269
const questions : inquirer . Questions = definitions . map ( definition => {
264
270
const question : inquirer . Question = {
You can’t perform that action at this time.
0 commit comments