File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -215,5 +215,14 @@ fs.templateData = function(path) {
215
215
return this . config . getPath ( path ) ;
216
216
}
217
217
218
- return this . config . getAll ( ) ;
218
+ const allConfig = this . config . getAll ( ) ;
219
+ if ( this . generatorConfig ) {
220
+ Object . assign ( allConfig , this . generatorConfig . getAll ( ) ) ;
221
+ }
222
+
223
+ if ( this . instanceConfig ) {
224
+ Object . assign ( allConfig , this . instanceConfig . getAll ( ) ) ;
225
+ }
226
+
227
+ return allConfig ;
219
228
} ;
Original file line number Diff line number Diff line change @@ -151,6 +151,8 @@ class Generator extends EventEmitter {
151
151
this . _arguments = [ ] ;
152
152
this . _composedWith = [ ] ;
153
153
this . _transformStreams = [ ] ;
154
+ this . _namespace = this . options . namespace ;
155
+ this . _namespaceId = this . options . namespaceId ;
154
156
155
157
this . option ( 'help' , {
156
158
type : Boolean ,
@@ -274,6 +276,15 @@ class Generator extends EventEmitter {
274
276
275
277
this . appname = this . determineAppname ( ) ;
276
278
this . config = this . _getStorage ( ) ;
279
+ if ( this . _namespaceId && this . _namespaceId . generator ) {
280
+ this . generatorConfig = this . config . createStorage ( `:${ this . _namespaceId . generator } ` ) ;
281
+ if ( this . _namespaceId . instanceId ) {
282
+ this . instanceConfig = this . generatorConfig . createStorage (
283
+ `#${ this . _namespaceId . instanceId } `
284
+ ) ;
285
+ }
286
+ }
287
+
277
288
this . _globalConfig = this . _getGlobalStorage ( ) ;
278
289
279
290
// Ensure source/destination path, can be configured from subclasses
You can’t perform that action at this time.
0 commit comments