File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed
blueprints/ember-cli-addon-docs Expand file tree Collapse file tree 1 file changed +31
-1
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,39 @@ module.exports = {
6363 }
6464
6565 if ( ! hasPlugins ) {
66+ return this . _chooseAddonsToInstall ( )
67+ . then ( ( addon ) => {
68+ return this . addAddonsToProject ( {
69+ packages : [ addon ] ,
70+ blueprintOptions : {
71+ save : options . save
72+ }
73+ } ) ;
74+ } ) ;
6675 return this . addAddonsToProject ( {
6776 packages : [ 'ember-cli-addon-docs-yuidoc' ]
6877 } ) ;
6978 }
79+ } ,
80+
81+ _chooseAddonsToInstall ( ) {
82+ // Ask which ember addon to install
83+ return this . ui . prompt ( {
84+ type : 'list' ,
85+ name : 'addonToInstall' ,
86+ message : 'Which documentation style would you like to use?' ,
87+ choices : [
88+ {
89+ name : 'ESDoc' ,
90+ value : { name : 'ember-cli-addon-docs-esdoc' }
91+ } ,
92+ {
93+ name : 'YUIDoc' ,
94+ value : { name : 'ember-cli-addon-docs-yuidoc' }
95+ }
96+ ]
97+ } ) . then ( ( selected ) => {
98+ return selected . addonToInstall ;
99+ } ) ;
70100 }
71101} ;
You can’t perform that action at this time.
0 commit comments