lifecycle-cmd.js 489 B

123456789101112131415161718
  1. // The implementation of commands that are just "run a script"
  2. // restart, start, stop, test
  3. const BaseCommand = require('../base-command.js')
  4. class LifecycleCmd extends BaseCommand {
  5. static get usage () {
  6. return ['[-- <args>]']
  7. }
  8. exec (args, cb) {
  9. this.npm.commands['run-script']([this.constructor.name, ...args], cb)
  10. }
  11. execWorkspaces (args, filters, cb) {
  12. this.npm.commands['run-script']([this.constructor.name, ...args], cb)
  13. }
  14. }
  15. module.exports = LifecycleCmd