aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/peertube-plugins.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tools/peertube-plugins.ts')
-rw-r--r--server/tools/peertube-plugins.ts16
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
3import { registerTSPaths } from '../helpers/register-ts-paths'
4registerTSPaths()
5
6import { program, Command, OptionValues } from 'commander'
7import { assignToken, buildServer, getServerCredentials } from './cli'
8import { PluginType } from '../../shared/models'
9import { isAbsolute } from 'path'
10import CliTable3 from 'cli-table3' 1import CliTable3 from 'cli-table3'
2import { Command, OptionValues, program } from 'commander'
3import { isAbsolute } from 'path'
4import { PluginType } from '../../shared/models'
5import { assignToken, buildServer, getServerCredentials } from './cli'
11 6
12program 7program
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
36program 32program
@@ -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)