File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,6 +31,13 @@ module.exports = class extends Generator {
3131 name : 'docker' ,
3232 message : 'Your project name on docker hub, such as foo/bar' ,
3333 required : false
34+ } ,
35+ {
36+ name : 'evaqueue' ,
37+ type : 'confirm' ,
38+ message : 'Use EvaQueue in your project?' ,
39+ default : true ,
40+ required : true
3441 }
3542 ] ;
3643
@@ -75,5 +82,9 @@ module.exports = class extends Generator {
7582 ) ;
7683 return true ;
7784 } ) ;
85+
86+ if ( this . props . evaqueue ) {
87+ this . composeWith ( require . resolve ( '../evaqueue' ) ) ;
88+ }
7889 }
7990} ;
Original file line number Diff line number Diff line change 1+ const Generator = require ( 'yeoman-generator' ) ;
2+
3+ module . exports = class extends Generator {
4+ constructor ( args , options ) {
5+ super ( args , options ) ;
6+
7+ this . option ( 'generateInto' , {
8+ type : String ,
9+ required : false ,
10+ default : '' ,
11+ desc : 'Relocate the location of the generated files.'
12+ } ) ;
13+ }
14+
15+ writing ( ) {
16+ const pkgJson = {
17+ dependencies : {
18+ evaqueue : '^1.0.0' ,
19+ 'node-rdkafka' : '^2.3.4' ,
20+ 'ali-mns' : '^2.6.5'
21+ } ,
22+ scripts : {
23+ 'install:evaqueue:mac' : 'CPPFLAGS=-I/usr/local/opt/openssl/include LDFLAGS=-L/usr/local/opt/openssl/lib npm install'
24+ }
25+ } ;
26+
27+ this . fs . extendJSON (
28+ this . destinationPath ( this . options . generateInto , 'package.json' ) ,
29+ pkgJson
30+ ) ;
31+ }
32+ } ;
You can’t perform that action at this time.
0 commit comments