2024-05-01 14:53:22 +08:00
|
|
|
const BaseCommand = require('./base-cmd.js')
|
|
|
|
|
2021-11-05 04:42:47 +08:00
|
|
|
// The implementation of commands that are just "run a script"
|
|
|
|
// restart, start, stop, test
|
|
|
|
class LifecycleCmd extends BaseCommand {
|
2021-11-19 04:58:02 +08:00
|
|
|
static usage = ['[-- <args>]']
|
2022-04-01 06:43:17 +08:00
|
|
|
static isShellout = true
|
2023-01-17 11:38:23 +08:00
|
|
|
static workspaces = true
|
|
|
|
static ignoreImplicitWorkspace = false
|
2021-11-05 04:42:47 +08:00
|
|
|
|
2023-01-17 11:38:23 +08:00
|
|
|
async exec (args) {
|
2021-11-05 04:42:47 +08:00
|
|
|
return this.npm.exec('run-script', [this.constructor.name, ...args])
|
|
|
|
}
|
|
|
|
|
2023-01-17 11:38:23 +08:00
|
|
|
async execWorkspaces (args) {
|
2021-11-05 04:42:47 +08:00
|
|
|
return this.npm.exec('run-script', [this.constructor.name, ...args])
|
|
|
|
}
|
|
|
|
}
|
2024-05-01 14:53:22 +08:00
|
|
|
|
2021-11-05 04:42:47 +08:00
|
|
|
module.exports = LifecycleCmd
|