diff options
Diffstat (limited to 'server/tools/peertube-plugins.ts')
-rw-r--r-- | server/tools/peertube-plugins.ts | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/server/tools/peertube-plugins.ts b/server/tools/peertube-plugins.ts index ae625114d..47090b3a5 100644 --- a/server/tools/peertube-plugins.ts +++ b/server/tools/peertube-plugins.ts | |||
@@ -1,13 +1,8 @@ | |||
1 | // eslint-disable @typescript-eslint/no-unnecessary-type-assertion | ||
2 | |||
3 | import { registerTSPaths } from '../helpers/register-ts-paths' | ||
4 | registerTSPaths() | ||
5 | |||
6 | import { program, Command, OptionValues } from 'commander' | ||
7 | import { assignToken, buildServer, getServerCredentials } from './cli' | ||
8 | import { PluginType } from '../../shared/models' | ||
9 | import { isAbsolute } from 'path' | ||
10 | import CliTable3 from 'cli-table3' | 1 | import CliTable3 from 'cli-table3' |
2 | import { Command, OptionValues, program } from 'commander' | ||
3 | import { isAbsolute } from 'path' | ||
4 | import { PluginType } from '../../shared/models' | ||
5 | import { assignToken, buildServer, getServerCredentials } from './cli' | ||
11 | 6 | ||
12 | program | 7 | program |
13 | .name('plugins') | 8 | .name('plugins') |
@@ -31,6 +26,7 @@ program | |||
31 | .option('-p, --password <token>', 'Password') | 26 | .option('-p, --password <token>', 'Password') |
32 | .option('-P --path <path>', 'Install from a path') | 27 | .option('-P --path <path>', 'Install from a path') |
33 | .option('-n, --npm-name <npmName>', 'Install from npm') | 28 | .option('-n, --npm-name <npmName>', 'Install from npm') |
29 | .option('--plugin-version <pluginVersion>', 'Specify the plugin version to install (only available when installing from npm)') | ||
34 | .action((options, command) => installPluginCLI(command, options)) | 30 | .action((options, command) => installPluginCLI(command, options)) |
35 | 31 | ||
36 | program | 32 | program |
@@ -109,7 +105,7 @@ async function installPluginCLI (command: Command, options: OptionValues) { | |||
109 | await assignToken(server, username, password) | 105 | await assignToken(server, username, password) |
110 | 106 | ||
111 | try { | 107 | try { |
112 | await server.plugins.install({ npmName: options.npmName, path: options.path }) | 108 | await server.plugins.install({ npmName: options.npmName, path: options.path, pluginVersion: options.pluginVersion }) |
113 | } catch (err) { | 109 | } catch (err) { |
114 | console.error('Cannot install plugin.', err) | 110 | console.error('Cannot install plugin.', err) |
115 | process.exit(-1) | 111 | process.exit(-1) |