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

Method toPNPMArgs

lib/tasks/npm-task.js:296–324  ·  view source on GitHub ↗
(command, options)

Source from the content-addressed store, hash-verified

294 }
295
296 toPNPMArgs(command, options) {
297 let args = [];
298
299 if (command === 'install') {
300 if (options.save) {
301 args.push('add');
302 } else if (options['save-dev']) {
303 args.push('add', '--save-dev');
304 } else if (options.packages) {
305 throw new Error(`npm command "${command} ${options.packages.join(' ')}" can not be translated to pnpm command`);
306 } else {
307 args.push('install');
308 }
309
310 if (options['save-exact']) {
311 args.push('--save-exact');
312 }
313 } else if (command === 'uninstall') {
314 args.push('remove');
315 } else {
316 throw new Error(`npm command "${command}" can not be translated to pnpm command`);
317 }
318
319 if (options.packages) {
320 args = args.concat(options.packages);
321 }
322
323 return args;
324 }
325
326 formatStartMessage(/* packages */) {
327 return '';

Callers 2

runMethod · 0.95
npm-task-test.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected