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/utils
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/lifecycle-cmd.js15
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/utils/lifecycle-cmd.js b/lib/utils/lifecycle-cmd.js
index 8be9b5a12..1917bef36 100644
--- a/lib/utils/lifecycle-cmd.js
+++ b/lib/utils/lifecycle-cmd.js
@@ -1,19 +1,14 @@
// The implementation of commands that are just "run a script"
// restart, start, stop, test
-const usageUtil = require('./usage.js')
-class LifecycleCmd {
- constructor (npm, stage) {
- this.npm = npm
- this.stage = stage
- }
-
- get usage () {
- return usageUtil(this.stage, `npm ${this.stage} [-- <args>]`)
+const BaseCommand = require('../base-command.js')
+class LifecycleCmd extends BaseCommand {
+ static get usage () {
+ return ['[-- <args>]']
}
exec (args, cb) {
- this.npm.commands['run-script']([this.stage, ...args], cb)
+ this.npm.commands['run-script']([this.constructor.name, ...args], cb)
}
}
module.exports = LifecycleCmd