Skip to content
This repository was archived by the owner on Mar 26, 2018. It is now read-only.

Commit e73ffc4

Browse files
eddiemongepassy
authored andcommitted
fix(app): Bootstrap Compass no prompt on Bootstrap no
Changed how the Angular generator prompts for Bootstrap Compass. The following options are now separated and follow logic: - Bootstrap - Bootstrap Compass only if Bootstrap is selected Closes #187
1 parent fce54bd commit e73ffc4

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

app/index.js

+22-7
Original file line numberDiff line numberDiff line change
@@ -69,27 +69,42 @@ var Generator = module.exports = function Generator(args, options) {
6969

7070
util.inherits(Generator, yeoman.generators.NamedBase);
7171

72-
Generator.prototype.askFor = function askFor() {
72+
Generator.prototype.askForBootstrap = function askForBootstrap() {
7373
var cb = this.async();
7474

75-
var prompts = [{
75+
this.prompt({
7676
name: 'bootstrap',
7777
message: 'Would you like to include Twitter Bootstrap?',
7878
default: 'Y/n',
7979
warning: 'Yes: All Twitter Bootstrap files will be placed into the styles directory.'
80-
}, {
80+
}, function (err, props) {
81+
if (err) {
82+
return this.emit('error', err);
83+
}
84+
85+
this.bootstrap = (/y/i).test(props.bootstrap);
86+
87+
cb();
88+
}.bind(this));
89+
};
90+
91+
Generator.prototype.askForCompass = function askForCompass() {
92+
if (!this.bootstrap) {
93+
return;
94+
}
95+
96+
var cb = this.async();
97+
98+
this.prompt({
8199
name: 'compassBootstrap',
82100
message: 'If so, would you like to use Twitter Bootstrap for Compass (as opposed to vanilla CSS)?',
83101
default: 'Y/n',
84102
warning: 'Yes: All Twitter Bootstrap files will be placed into the styles directory.'
85-
}];
86-
87-
this.prompt(prompts, function (err, props) {
103+
}, function (err, props) {
88104
if (err) {
89105
return this.emit('error', err);
90106
}
91107

92-
this.bootstrap = (/y/i).test(props.bootstrap);
93108
this.compassBootstrap = (/y/i).test(props.compassBootstrap);
94109

95110
cb();

0 commit comments

Comments
 (0)