Skip to content

Commit 9d7d36e

Browse files
committed
add prompt to ask if you want to use existing yo-rc configuration
1 parent 25f041a commit 9d7d36e

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

app/index.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,31 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
2222
this.appPath = this.env.options.appPath;
2323
this.pkg = require('../package.json');
2424
this.filters = {};
25-
// skip config if filters are already defined
26-
if(this.config.get('filters')) {
27-
this.log('\nUsing existing yo-rc config.\n');
28-
this.skipConfig = true;
29-
}
3025
},
3126

3227
info: function () {
3328
this.log(this.yeoman);
3429
this.log('Out of the box I create an AngularJS app with an Express server.\n');
3530
},
3631

32+
checkForConfig: function() {
33+
var cb = this.async();
34+
35+
if(this.config.get('filters')) {
36+
this.prompt([{
37+
type: "confirm",
38+
name: "skipConfig",
39+
message: "Existing .yo-rc configuration found, would you like to use it?",
40+
default: true,
41+
}], function (answers) {
42+
this.skipConfig = answers.skipConfig;
43+
cb();
44+
}.bind(this));
45+
} else {
46+
cb();
47+
}
48+
},
49+
3750
clientPrompts: function() {
3851
if(this.skipConfig) return;
3952
var cb = this.async();

0 commit comments

Comments
 (0)