xref: /third_party/node/deps/npm/lib/commands/set.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/deps/npm/lib/commands/
11cb0ef41Sopenharmony_ciconst Npm = require('../npm.js')
21cb0ef41Sopenharmony_ciconst BaseCommand = require('../base-command.js')
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_ciclass Set extends BaseCommand {
51cb0ef41Sopenharmony_ci  static description = 'Set a value in the npm configuration'
61cb0ef41Sopenharmony_ci  static name = 'set'
71cb0ef41Sopenharmony_ci  static usage = ['<key>=<value> [<key>=<value> ...] (See `npm config`)']
81cb0ef41Sopenharmony_ci  static params = ['global', 'location']
91cb0ef41Sopenharmony_ci  static ignoreImplicitWorkspace = false
101cb0ef41Sopenharmony_ci
111cb0ef41Sopenharmony_ci  // TODO
121cb0ef41Sopenharmony_ci  /* istanbul ignore next */
131cb0ef41Sopenharmony_ci  static async completion (opts) {
141cb0ef41Sopenharmony_ci    const Config = Npm.cmd('config')
151cb0ef41Sopenharmony_ci    return Config.completion(opts)
161cb0ef41Sopenharmony_ci  }
171cb0ef41Sopenharmony_ci
181cb0ef41Sopenharmony_ci  async exec (args) {
191cb0ef41Sopenharmony_ci    if (!args.length) {
201cb0ef41Sopenharmony_ci      throw this.usageError()
211cb0ef41Sopenharmony_ci    }
221cb0ef41Sopenharmony_ci    return this.npm.exec('config', ['set'].concat(args))
231cb0ef41Sopenharmony_ci  }
241cb0ef41Sopenharmony_ci}
251cb0ef41Sopenharmony_cimodule.exports = Set
26

Indexes created Thu Nov 07 10:32:03 CST 2024