Skip to content

Commit 27e8cff

Browse files
Add prompt for ESDoc/YUIDoc
This adds a prompt so you can select ESDoc or YUIDoc when the blueprints run.
1 parent ffef356 commit 27e8cff

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

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

Lines changed: 31 additions & 1 deletion
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,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
};

0 commit comments

Comments
 (0)