(args)
| 42 | } |
| 43 | |
| 44 | async exec (args) { |
| 45 | const update = args.length === 0 ? true : args |
| 46 | const global = path.resolve(this.npm.globalDir, '..') |
| 47 | const where = this.npm.global ? global : this.npm.prefix |
| 48 | |
| 49 | // In the context of `npm update` the save config value should default to `false` |
| 50 | const save = this.npm.config.isDefault('save') |
| 51 | ? false |
| 52 | : this.npm.config.get('save') |
| 53 | |
| 54 | if (this.npm.config.get('depth')) { |
| 55 | log.warn('update', 'The --depth option no longer has any effect. See RFC0019.\n' + |
| 56 | 'https://github.com/npm/rfcs/blob/latest/implemented/0019-remove-update-depth-option.md') |
| 57 | } |
| 58 | |
| 59 | const Arborist = require('@npmcli/arborist') |
| 60 | const { policy: allowScriptsPolicy } = await resolveAllowScripts(this.npm) |
| 61 | const opts = { |
| 62 | ...this.npm.flatOptions, |
| 63 | path: where, |
| 64 | save, |
| 65 | workspaces: this.workspaceNames, |
| 66 | allowScripts: allowScriptsPolicy, |
| 67 | } |
| 68 | const arb = new Arborist(opts) |
| 69 | |
| 70 | const reifyOpts = { ...opts, update } |
| 71 | await strictAllowScriptsPreflight({ arb, npm: this.npm, idealTreeOpts: reifyOpts }) |
| 72 | await arb.reify(reifyOpts) |
| 73 | await reifyFinish(this.npm, arb) |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | module.exports = Update |
nothing calls this directly
no test coverage detected