diff options
author | Gar <gar+gh@danger.computer> | 2021-03-04 07:26:33 +0300 |
---|---|---|
committer | Gar <gar+gh@danger.computer> | 2021-03-09 22:10:06 +0300 |
commit | 9fe0df5b5d7606e5841288d9931be6c04767c9ca (patch) | |
tree | 50b916523fe4a5ebab6010b137cc931cc2a9ce70 /lib/ci.js | |
parent | 85a8694dd9b4a924a474ba75261914511a216868 (diff) |
fix(usage): clean up usage declarations
Small refactor of commands to allow usage to be more programmatically
generated, leading us in the direction of more tighly coupling each
command to the params it accepts.
PR-URL: https://github.com/npm/cli/pull/2821
Credit: @wraithgar
Close: #2821
Reviewed-by: @isaacs
Diffstat (limited to 'lib/ci.js')
-rw-r--r-- | lib/ci.js | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -7,7 +7,6 @@ const fs = require('fs') const readdir = util.promisify(fs.readdir) const log = require('npmlog') -const usageUtil = require('./utils/usage.js') const removeNodeModules = async where => { const rimrafOpts = { glob: false } @@ -18,15 +17,12 @@ const removeNodeModules = async where => { await Promise.all(entries.map(f => rimraf(`${path}/${f}`, rimrafOpts))) process.emit('timeEnd', 'npm-ci:rm') } +const BaseCommand = require('./base-command.js') -class CI { - constructor (npm) { - this.npm = npm - } - +class CI extends BaseCommand { /* istanbul ignore next - see test/lib/load-all-commands.js */ - get usage () { - return usageUtil('ci', 'npm ci') + static get name () { + return 'ci' } exec (args, cb) { |