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.ts11
1 files changed, 4 insertions, 7 deletions
diff --git a/server/tools/peertube-plugins.ts b/server/tools/peertube-plugins.ts
index 08e8cd713..cb591377b 100644
--- a/server/tools/peertube-plugins.ts
+++ b/server/tools/peertube-plugins.ts
@@ -4,10 +4,9 @@ import { registerTSPaths } from '../helpers/register-ts-paths'
4registerTSPaths() 4registerTSPaths()
5 5
6import * as program from 'commander' 6import * as program from 'commander'
7import { PluginType } from '../../shared/models/plugins/plugin.type'
8import { installPlugin, listPlugins, uninstallPlugin, updatePlugin } from '../../shared/extra-utils/server/plugins' 7import { installPlugin, listPlugins, uninstallPlugin, updatePlugin } from '../../shared/extra-utils/server/plugins'
9import { getAdminTokenOrDie, getServerCredentials } from './cli' 8import { getAdminTokenOrDie, getServerCredentials } from './cli'
10import { PeerTubePlugin } from '../../shared/models/plugins/peertube-plugin.model' 9import { PeerTubePlugin, PluginType } from '../../shared/models'
11import { isAbsolute } from 'path' 10import { isAbsolute } from 'path'
12import * as CliTable3 from 'cli-table3' 11import * as CliTable3 from 'cli-table3'
13import commander = require('commander') 12import commander = require('commander')
@@ -24,7 +23,7 @@ program
24 .option('-p, --password <token>', 'Password') 23 .option('-p, --password <token>', 'Password')
25 .option('-t, --only-themes', 'List themes only') 24 .option('-t, --only-themes', 'List themes only')
26 .option('-P, --only-plugins', 'List plugins only') 25 .option('-P, --only-plugins', 'List plugins only')
27 .action(() => pluginsListCLI()) 26 .action((options, command) => pluginsListCLI(command, options))
28 27
29program 28program
30 .command('install') 29 .command('install')
@@ -61,12 +60,10 @@ if (!process.argv.slice(2).length) {
61 60
62program.parse(process.argv) 61program.parse(process.argv)
63 62
64const options = program.opts()
65
66// ---------------------------------------------------------------------------- 63// ----------------------------------------------------------------------------
67 64
68async function pluginsListCLI () { 65async function pluginsListCLI (command: commander.CommanderStatic, options: commander.OptionValues) {
69 const { url, username, password } = await getServerCredentials(program) 66 const { url, username, password } = await getServerCredentials(command)
70 const accessToken = await getAdminTokenOrDie(url, username, password) 67 const accessToken = await getAdminTokenOrDie(url, username, password)
71 68
72 let pluginType: PluginType 69 let pluginType: PluginType