CLI: plugins install command accept a --plugin-version parameter. (#4599)
* CLI: plugins install command accept a --plugin-version parameter. * Unit tests for plugins install --plugin-version. * Fix linting. * Styling Co-authored-by: Chocobozzz <me@florianbigard.com>
This commit is contained in:
parent
37cb07eae2
commit
3a1157a68a
6 changed files with 37 additions and 4 deletions
|
@ -31,6 +31,7 @@ program
|
|||
.option('-p, --password <token>', 'Password')
|
||||
.option('-P --path <path>', 'Install from a path')
|
||||
.option('-n, --npm-name <npmName>', 'Install from npm')
|
||||
.option('--plugin-version <pluginVersion>', 'Specify the plugin version to install (only available when installing from npm)')
|
||||
.action((options, command) => installPluginCLI(command, options))
|
||||
|
||||
program
|
||||
|
@ -109,7 +110,7 @@ async function installPluginCLI (command: Command, options: OptionValues) {
|
|||
await assignToken(server, username, password)
|
||||
|
||||
try {
|
||||
await server.plugins.install({ npmName: options.npmName, path: options.path })
|
||||
await server.plugins.install({ npmName: options.npmName, path: options.path, pluginVersion: options.pluginVersion })
|
||||
} catch (err) {
|
||||
console.error('Cannot install plugin.', err)
|
||||
process.exit(-1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue