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

Method run

lib/tasks/npm-task.js:188–217  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

186 }
187
188 async run(options) {
189 this.packageManager = await this.findPackageManager(options.packageManager);
190
191 let ui = this.ui;
192 let startMessage = this.formatStartMessage(options.packages);
193 let completeMessage = this.formatCompleteMessage(options.packages);
194
195 const prependEmoji = require('@ember-tooling/blueprint-model/utilities/prepend-emoji');
196
197 ui.writeLine('');
198 ui.writeLine(prependEmoji('🚧', 'Installing packages... This might take a couple of minutes.'));
199 ui.startProgress(chalk.green(startMessage));
200
201 try {
202 if (this.packageManager.name === 'yarn') {
203 let args = this.toYarnArgs(this.command, options);
204 await this.yarn(args);
205 } else if (this.packageManager.name === 'pnpm') {
206 let args = this.toPNPMArgs(this.command, options);
207 await this.pnpm(args);
208 } else {
209 let args = this.toNpmArgs(this.command, options);
210 await this.npm(args);
211 }
212 } finally {
213 ui.stopProgress();
214 }
215
216 ui.writeLine(chalk.green(completeMessage));
217 }
218
219 toNpmArgs(command, options) {
220 let args = [command];

Callers

nothing calls this directly

Calls 9

findPackageManagerMethod · 0.95
formatStartMessageMethod · 0.95
formatCompleteMessageMethod · 0.95
toYarnArgsMethod · 0.95
yarnMethod · 0.95
toPNPMArgsMethod · 0.95
pnpmMethod · 0.95
toNpmArgsMethod · 0.95
npmMethod · 0.95

Tested by

no test coverage detected