@@ -69,28 +69,43 @@ var Generator = module.exports = function Generator(args, options) {
6969
7070util . 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?' ,
78- default : 'Y/n' ,
78+ default : true ,
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 = 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)?' ,
83- default : 'Y/n' ,
101+ default : true ,
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 ) ;
93- this . compassBootstrap = ( / y / i) . test ( props . compassBootstrap ) ;
108+ this . compassBootstrap = props . compassBootstrap ;
94109
95110 cb ( ) ;
96111 } . bind ( this ) ) ;
@@ -102,17 +117,17 @@ Generator.prototype.askForModules = function askForModules() {
102117 var prompts = [ {
103118 name : 'resourceModule' ,
104119 message : 'Would you like to include angular-resource.js?' ,
105- default : 'Y/n' ,
120+ default : true ,
106121 warning : 'Yes: angular-resource added to bower.json'
107122 } , {
108123 name : 'cookiesModule' ,
109124 message : 'Would you like to include angular-cookies.js?' ,
110- default : 'Y/n' ,
125+ default : true ,
111126 warning : 'Yes: angular-cookies added to bower.json'
112127 } , {
113128 name : 'sanitizeModule' ,
114129 message : 'Would you like to include angular-sanitize.js?' ,
115- default : 'Y/n' ,
130+ default : true ,
116131 warning : 'Yes: angular-sanitize added to bower.json'
117132 } ] ;
118133
@@ -121,9 +136,9 @@ Generator.prototype.askForModules = function askForModules() {
121136 return this . emit ( 'error' , err ) ;
122137 }
123138
124- this . resourceModule = ( / y / i ) . test ( props . resourceModule ) ;
125- this . cookiesModule = ( / y / i ) . test ( props . cookiesModule ) ;
126- this . sanitizeModule = ( / y / i ) . test ( props . sanitizeModule ) ;
139+ this . resourceModule = props . resourceModule ;
140+ this . cookiesModule = props . cookiesModule ;
141+ this . sanitizeModule = props . sanitizeModule ;
127142
128143 cb ( ) ;
129144 } . bind ( this ) ) ;
0 commit comments