Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/ci.js
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2021-03-04 07:26:33 +0300
committerGar <gar+gh@danger.computer>2021-03-09 22:10:06 +0300
commit9fe0df5b5d7606e5841288d9931be6c04767c9ca (patch)
tree50b916523fe4a5ebab6010b137cc931cc2a9ce70 /lib/ci.js
parent85a8694dd9b4a924a474ba75261914511a216868 (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.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/ci.js b/lib/ci.js
index 03a91a604..3ea199376 100644
--- a/lib/ci.js
+++ b/lib/ci.js
@@ -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) {