@@ -36,6 +36,8 @@ function usage(exitCode = 0): never {
36
36
Options:
37
37
--debug Debug mode. This is true by default if the collection is a relative
38
38
path (in that case, turn off with --debug=false).
39
+ --allowPrivate Allow private schematics to be run from the command line. Default to
40
+ false.
39
41
--dry-run Do not output anything, but instead just show what actions would be
40
42
performed. Default to true if debug is also true.
41
43
--force Force overwriting files that would otherwise be an error.
@@ -87,7 +89,15 @@ function parseSchematicName(str: string | null): { collection: string, schematic
87
89
88
90
89
91
/** Parse the command line. */
90
- const booleanArgs = [ 'debug' , 'dry-run' , 'force' , 'help' , 'list-schematics' , 'verbose' ] ;
92
+ const booleanArgs = [
93
+ 'allowPrivate' ,
94
+ 'debug' ,
95
+ 'dry-run' ,
96
+ 'force' ,
97
+ 'help' ,
98
+ 'list-schematics' ,
99
+ 'verbose' ,
100
+ ] ;
91
101
const argv = minimist ( process . argv . slice ( 2 ) , {
92
102
boolean : booleanArgs ,
93
103
default : {
@@ -124,6 +134,7 @@ if (argv['list-schematics']) {
124
134
const debug : boolean = argv . debug === null ? isLocalCollection : argv . debug ;
125
135
const dryRun : boolean = argv [ 'dry-run' ] === null ? debug : argv [ 'dry-run' ] ;
126
136
const force = argv [ 'force' ] ;
137
+ const allowPrivate = argv [ 'allowPrivate' ] ;
127
138
128
139
/** Create a Virtual FS Host scoped to where the process is being run. **/
129
140
const fsHost = new virtualFs . ScopedHost ( new NodeJsSyncHost ( ) , normalize ( process . cwd ( ) ) ) ;
@@ -137,7 +148,7 @@ let nothingDone = true;
137
148
138
149
// Logging queue that receives all the messages to show the users. This only get shown when no
139
150
// errors happened.
140
- const loggingQueue : string [ ] = [ ] ;
151
+ let loggingQueue : string [ ] = [ ] ;
141
152
let error = false ;
142
153
143
154
/**
@@ -190,6 +201,7 @@ workflow.lifeCycle.subscribe(event => {
190
201
loggingQueue . forEach ( log => logger . info ( log ) ) ;
191
202
}
192
203
204
+ loggingQueue = [ ] ;
193
205
error = false ;
194
206
}
195
207
} ) ;
@@ -235,6 +247,7 @@ workflow.execute({
235
247
collection : collectionName ,
236
248
schematic : schematicName ,
237
249
options : args ,
250
+ allowPrivate : allowPrivate ,
238
251
debug : debug ,
239
252
logger : logger ,
240
253
} )
0 commit comments