@@ -9,25 +9,33 @@ module.exports = Generator;
99function Generator ( ) {
1010 yeoman . generators . NamedBase . apply ( this , arguments ) ;
1111
12- this . option ( 'coffee' ) ;
12+ if ( typeof this . env . options . coffee === 'undefined' ) {
13+ this . option ( 'coffee' ) ;
1314
14- // attempt to detect if user is using CS or not
15- // if cml arg provided, use that; else look for the existence of cs
15+ // attempt to detect if user is using CS or not
16+ // if cml arg provided, use that; else look for the existence of cs
17+ if ( ! this . options . coffee &&
18+ this . expandFiles ( '/app/scripts/**/*.coffee' , { } ) . length > 0 ) {
19+ this . options . coffee = true ;
20+ }
1621
17- if ( ! this . options . coffee &&
18- this . expandFiles ( '/app/scripts/**/*.coffee' , { } ) . length > 0 ) {
19- this . options . coffee = true ;
22+ this . env . options . coffee = this . options . coffee ;
23+ }
24+
25+ if ( typeof this . env . options . minsafe === 'undefined' ) {
26+ this . option ( 'minsafe' ) ;
27+ this . env . options . minsafe = this . options . minsafe ;
2028 }
2129
2230 var sourceRoot = '/templates/javascript' ;
2331 this . scriptSuffix = '.js' ;
2432
25- if ( this . options . coffee ) {
33+ if ( this . env . options . coffee ) {
2634 sourceRoot = '/templates/coffeescript' ;
2735 this . scriptSuffix = '.coffee' ;
2836 }
2937
30- if ( this . options . minsafe ) {
38+ if ( this . env . options . minsafe ) {
3139 sourceRoot += '-min' ;
3240 }
3341
0 commit comments