Skip to content

Commit 806ca88

Browse files
authored
Merge pull request #248 from rwwagner90/docs-prompt
Add prompt for ESDoc/YUIDoc
2 parents 1033aac + 4ea2fb5 commit 806ca88

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

blueprints/ember-cli-addon-docs/index.js

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff 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
};

0 commit comments

Comments
 (0)