File tree Expand file tree Collapse file tree 1 file changed +31
-4
lines changed
blueprints/ember-cli-addon-docs Expand file tree Collapse file tree 1 file changed +31
-4
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ module.exports = {
2222 } ) ;
2323 } ,
2424
25- afterInstall ( ) {
25+ afterInstall ( options ) {
2626 let configPath = require . resolve ( this . project . configPath ( ) ) ;
2727 let configContents = fs . readFileSync ( configPath , 'utf-8' ) ;
2828
@@ -63,9 +63,36 @@ module.exports = {
6363 }
6464
6565 if ( ! hasPlugins ) {
66- return this . addAddonsToProject ( {
67- packages : [ 'ember-cli-addon-docs-yuidoc' ]
68- } ) ;
66+ return this . _chooseAddonsToInstall ( )
67+ . then ( ( addon ) => {
68+ return this . addAddonsToProject ( {
69+ packages : [ addon ] ,
70+ blueprintOptions : {
71+ save : options . save
72+ }
73+ } ) ;
74+ } ) ;
6975 }
76+ } ,
77+
78+ _chooseAddonsToInstall ( ) {
79+ // Ask which ember addon to install
80+ return this . ui . prompt ( {
81+ type : 'list' ,
82+ name : 'addonToInstall' ,
83+ message : 'Which documentation style would you like to use?' ,
84+ choices : [
85+ {
86+ name : 'ESDoc' ,
87+ value : { name : 'ember-cli-addon-docs-esdoc' }
88+ } ,
89+ {
90+ name : 'YUIDoc' ,
91+ value : { name : 'ember-cli-addon-docs-yuidoc' }
92+ }
93+ ]
94+ } ) . then ( ( selected ) => {
95+ return selected . addonToInstall ;
96+ } ) ;
7097 }
7198} ;
You can’t perform that action at this time.
0 commit comments