MCPcopy Create free account
hub / github.com/ember-cli/ember-cli / generate

Method generate

lib/utilities/json-generator.js:19–51  ·  view source on GitHub ↗
(commandOptions)

Source from the content-addressed store, hash-verified

17 }
18
19 generate(commandOptions) {
20 let rootCommand = new RootCommand({
21 ui: this.ui,
22 project: this.project,
23 commands: this.commands,
24 tasks: this.tasks,
25 });
26
27 let json = rootCommand.getJson(commandOptions);
28 json.version = emberCLIVersion();
29 json.commands = [];
30 json.addons = [];
31
32 Object.keys(this.commands).forEach(function (commandName) {
33 this._addCommandHelpToJson(commandName, commandOptions, json);
34 }, this);
35
36 if (this.project.eachAddonCommand) {
37 this.project.eachAddonCommand((addonName, commands) => {
38 this.commands = commands;
39
40 let addonJson = { name: addonName };
41 addonJson.commands = [];
42 json.addons.push(addonJson);
43
44 Object.keys(this.commands).forEach(function (commandName) {
45 this._addCommandHelpToJson(commandName, commandOptions, addonJson);
46 }, this);
47 });
48 }
49
50 return json;
51 }
52
53 _addCommandHelpToJson(commandName, options, json) {
54 let command = this._lookupCommand(commandName);

Callers 1

_printJsonHelpFunction · 0.95

Calls 3

_addCommandHelpToJsonMethod · 0.95
emberCLIVersionFunction · 0.85
eachAddonCommandMethod · 0.80

Tested by

no test coverage detected