Skip to content

Commit b370180

Browse files
committed
fix(gen): force config update when it exists and skipConfig == false
Requires DaftMonk/generator-ng-component#21
1 parent a89c612 commit b370180

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

Diff for: app/generator.js

+12-10
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ export default class Generator extends Base {
4444

4545
checkForConfig: function() {
4646
var cb = this.async();
47+
var existingFilters = this.config.get('filters');
4748

48-
if(this.config.get('filters')) {
49+
if(existingFilters) {
4950
this.prompt([{
5051
type: 'confirm',
5152
name: 'skipConfig',
@@ -54,14 +55,14 @@ export default class Generator extends Base {
5455
}], function (answers) {
5556
this.skipConfig = answers.skipConfig;
5657

57-
this.filters = this.lodash.defaults(this.config.get('filters'), {
58-
bootstrap: true,
59-
uibootstrap: true,
60-
jasmine: true
61-
});
62-
63-
this.config.set('filters', this.filters);
64-
this.config.forceSave();
58+
if (this.skipConfig) {
59+
this.filters = existingFilters;
60+
} else {
61+
this.filters = {};
62+
this.forceConfig = true;
63+
this.config.set('filters', this.filters);
64+
this.config.forceSave();
65+
}
6566

6667
cb();
6768
}.bind(this));
@@ -357,7 +358,8 @@ export default class Generator extends Base {
357358
'serviceDirectory': appPath,
358359
'filters': filters,
359360
'extensions': extensions,
360-
'basePath': 'client'
361+
'basePath': 'client',
362+
'forceConfig': this.forceConfig
361363
}
362364
}, { local: require.resolve('generator-ng-component/app/index.js') });
363365
},

0 commit comments

Comments
 (0)