MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / maybeMakeCommand

Method maybeMakeCommand

lib/cli/cli.js:84–113  ·  view source on GitHub ↗

* @private * @method maybeMakeCommand * @param commandName * @param commandArgs * @return {null|CurrentCommand}

(commandName, commandArgs)

Source from the content-addressed store, hash-verified

82 * @return {null|CurrentCommand}
83 */
84 maybeMakeCommand(commandName, commandArgs) {
85 if (this._environment === undefined) {
86 throw new Error('Unable to make command without environment, you have to execute "run" method first.');
87 }
88 let CurrentCommand = lookupCommand(this._environment.commands, commandName, commandArgs, {
89 project: this._environment.project,
90 ui: this.ui,
91 });
92
93 /*
94 * XXX Need to decide what to do here about showing errors. For
95 * a non-CLI project the cache is local and probably should. For
96 * a CLI project the cache is there, but not sure when we'll know
97 * about all the errors, because there may be multiple projects.
98 * if (this.packageInfoCache.hasErrors()) {
99 * this.packageInfoCache.showErrors();
100 * }
101 */
102 let command = new CurrentCommand({
103 ui: this.ui,
104 commands: this._environment.commands,
105 tasks: this._environment.tasks,
106 project: this._environment.project,
107 settings: this._environment.settings,
108 testing: this.testing,
109 cli: this,
110 });
111
112 return command;
113 }
114
115 /**
116 * @private

Callers 2

runMethod · 0.95
cli-test.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected