| 381 | } |
| 382 | |
| 383 | printPruneSummary ({ removed, dryRun }) { |
| 384 | if (this.npm.flatOptions.json) { |
| 385 | output.buffer({ allowScripts: { removed, dryRun } }) |
| 386 | return |
| 387 | } |
| 388 | if (removed.length === 0) { |
| 389 | output.standard('No unused allowScripts entries.') |
| 390 | return |
| 391 | } |
| 392 | const entry = removed.length === 1 ? 'entry' : 'entries' |
| 393 | output.standard( |
| 394 | `${dryRun ? 'Would remove' : 'Removed'} ${removed.length} unused allowScripts ${entry}:` |
| 395 | ) |
| 396 | for (const { key, reason } of removed) { |
| 397 | const text = reason === 'not-installed' ? 'package not installed' : 'no install scripts' |
| 398 | output.standard(` ${key} (${text})`) |
| 399 | } |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | module.exports = AllowScriptsCmd |