File tree Expand file tree Collapse file tree 1 file changed +32
-19
lines changed Expand file tree Collapse file tree 1 file changed +32
-19
lines changed Original file line number Diff line number Diff line change 1
1
var fs = require ( 'fs' ) ;
2
2
var path = require ( 'path' ) ;
3
3
var chalk = require ( 'chalk' ) ;
4
+ var yeoman = require ( 'yeoman-generator' ) ;
5
+ var util = require ( 'util' ) ;
4
6
5
- var Generator = module . exports = function ( ) {
6
- var prompts = [ ] ;
7
- var files = this . expandFiles ( '**/*' , { cwd : this . sourceRoot ( ) , dot : true } ) ;
8
- var ignores = [
9
- '.git' ,
10
- 'LICENSE' ,
11
- 'README.md' ,
12
- ] ;
7
+ module . exports = yeoman . generators . Base . extend ( {
13
8
14
- this . package = JSON . parse ( this . readFileAsString ( path . join ( __dirname , '../package.json' ) ) ) ;
9
+ constructor : function ( ) {
10
+ yeoman . generators . Base . apply ( this , arguments ) ;
15
11
16
- this . log . writeln ( 'Generating from ' + chalk . cyan ( 'jQuery Boilerplate' ) + ' v' + chalk . cyan ( this . package . version ) + '...' ) ;
12
+ } ,
17
13
18
- files . forEach ( function ( file ) {
19
- if ( ignores . indexOf ( file ) !== - 1 ) {
20
- return ;
21
- }
14
+ install : function ( ) {
15
+ var prompts = [ ] ;
22
16
23
- this . copy ( file , file ) ;
24
- } , this ) ;
17
+ this . name = "jQuery Boilerplate" ;
25
18
26
- this . config . save ( ) ;
27
- } ;
19
+ this . files = this . expandFiles ( '**/*' , { cwd : this . sourceRoot ( ) , dot : true } ) ;
28
20
29
- Generator . name = "jQuery Boilerplate" ;
21
+ var ignores = [
22
+ '.git' ,
23
+ 'LICENSE' ,
24
+ 'README.md' ,
25
+ ] ;
26
+
27
+ this . files . forEach ( function ( file ) {
28
+ if ( ignores . indexOf ( file ) !== - 1 ) {
29
+ return ;
30
+ }
31
+
32
+ this . copy ( file , file ) ;
33
+ } , this ) ;
34
+
35
+ this . config . save ( ) ;
36
+
37
+ this . package = JSON . parse ( this . readFileAsString ( path . resolve ( __dirname , '../package.json' ) ) ) ;
38
+
39
+ this . log . writeln ( 'Generating from ' + chalk . cyan ( 'jQuery Boilerplate' ) + ' v' + chalk . cyan ( this . package . version ) + '...' ) ;
40
+ }
41
+
42
+ } ) ;
You can’t perform that action at this time.
0 commit comments