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

Commit

Permalink
fix(app): Bootstrap Compass no prompt on Bootstrap no
Browse files Browse the repository at this point in the history
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
  • Loading branch information
eddiemonge authored and passy committed May 7, 2013
1 parent fce54bd commit e73ffc4
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,27 +69,42 @@ var Generator = module.exports = function Generator(args, options) {

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

Generator.prototype.askFor = function askFor() {
Generator.prototype.askForBootstrap = function askForBootstrap() {
var cb = this.async();

var prompts = [{
this.prompt({
name: 'bootstrap',
message: 'Would you like to include Twitter Bootstrap?',
default: 'Y/n',
warning: 'Yes: All Twitter Bootstrap files will be placed into the styles directory.'
}, {
}, function (err, props) {
if (err) {
return this.emit('error', err);
}

this.bootstrap = (/y/i).test(props.bootstrap);

cb();
}.bind(this));
};

Generator.prototype.askForCompass = function askForCompass() {
if (!this.bootstrap) {
return;
}

var cb = this.async();

this.prompt({
name: 'compassBootstrap',
message: 'If so, would you like to use Twitter Bootstrap for Compass (as opposed to vanilla CSS)?',
default: 'Y/n',
warning: 'Yes: All Twitter Bootstrap files will be placed into the styles directory.'
}];

this.prompt(prompts, function (err, props) {
}, function (err, props) {
if (err) {
return this.emit('error', err);
}

this.bootstrap = (/y/i).test(props.bootstrap);
this.compassBootstrap = (/y/i).test(props.compassBootstrap);

cb();
Expand Down

0 comments on commit e73ffc4

Please sign in to comment.