Skip to content
This repository was archived by the owner on Sep 18, 2024. It is now read-only.

Commit a024635

Browse files
committed
add prompt
1 parent a0881dc commit a024635

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

app/index.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,27 @@ ExpressGenerator.prototype.promptDatabase = function () {
8585
}.bind(this));
8686
};
8787

88+
ExpressGenerator.prototype.promptBuildTool = function () {
89+
var done = this.async();
90+
var prompt = [{
91+
type: 'list',
92+
name: 'buildTool',
93+
message: 'Select a build tool to use:',
94+
choices: [
95+
'Grunt',
96+
'Gulp'
97+
]
98+
}];
99+
100+
this.prompt(prompt, function (response) {
101+
this.options.buildTool = response.buildTool.toLowerCase();
102+
done();
103+
}.bind(this));
104+
};
105+
88106
ExpressGenerator.prototype.buildEnv = function buildEnv() {
89107
this.sourceRoot(path.join(__dirname, 'templates', 'common'));
90-
this.expandFiles('**', { cwd: this.sourceRoot() }).map(function(file) {
108+
this.expandFiles('**', { cwd: this.sourceRoot() }).map(function (file) {
91109
this.template(file, file.replace(/^_/, ''));
92110
}, this);
93111

0 commit comments

Comments
 (0)