File tree Expand file tree Collapse file tree 1 file changed +22
-7
lines changed
Expand file tree Collapse file tree 1 file changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -69,27 +69,42 @@ 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?' ,
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 ( ) ;
You can’t perform that action at this time.
0 commit comments