Skip to content

fix(gen): force config update when it exists and skipConfig == false #1256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 7, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions app/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ export default class Generator extends Base {

checkForConfig: function() {
var cb = this.async();
var existingFilters = this.config.get('filters');

if(this.config.get('filters')) {
if(existingFilters) {
this.prompt([{
type: 'confirm',
name: 'skipConfig',
Expand All @@ -54,14 +55,14 @@ export default class Generator extends Base {
}], function (answers) {
this.skipConfig = answers.skipConfig;

this.filters = this.lodash.defaults(this.config.get('filters'), {
bootstrap: true,
uibootstrap: true,
jasmine: true
});

this.config.set('filters', this.filters);
this.config.forceSave();
if (this.skipConfig) {
this.filters = existingFilters;
} else {
this.filters = {};
this.forceConfig = true;
this.config.set('filters', this.filters);
this.config.forceSave();
}

cb();
}.bind(this));
Expand Down Expand Up @@ -357,7 +358,8 @@ export default class Generator extends Base {
'serviceDirectory': appPath,
'filters': filters,
'extensions': extensions,
'basePath': 'client'
'basePath': 'client',
'forceConfig': this.forceConfig
}
}, { local: require.resolve('generator-ng-component/app/index.js') });
},
Expand Down