diff options
Diffstat (limited to 'server/tools/peertube-plugins.ts')
-rw-r--r-- | server/tools/peertube-plugins.ts | 11 |
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' | |||
4 | registerTSPaths() | 4 | registerTSPaths() |
5 | 5 | ||
6 | import * as program from 'commander' | 6 | import * as program from 'commander' |
7 | import { PluginType } from '../../shared/models/plugins/plugin.type' | ||
8 | import { installPlugin, listPlugins, uninstallPlugin, updatePlugin } from '../../shared/extra-utils/server/plugins' | 7 | import { installPlugin, listPlugins, uninstallPlugin, updatePlugin } from '../../shared/extra-utils/server/plugins' |
9 | import { getAdminTokenOrDie, getServerCredentials } from './cli' | 8 | import { getAdminTokenOrDie, getServerCredentials } from './cli' |
10 | import { PeerTubePlugin } from '../../shared/models/plugins/peertube-plugin.model' | 9 | import { PeerTubePlugin, PluginType } from '../../shared/models' |
11 | import { isAbsolute } from 'path' | 10 | import { isAbsolute } from 'path' |
12 | import * as CliTable3 from 'cli-table3' | 11 | import * as CliTable3 from 'cli-table3' |
13 | import commander = require('commander') | 12 | import 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 | ||
29 | program | 28 | program |
30 | .command('install') | 29 | .command('install') |
@@ -61,12 +60,10 @@ if (!process.argv.slice(2).length) { | |||
61 | 60 | ||
62 | program.parse(process.argv) | 61 | program.parse(process.argv) |
63 | 62 | ||
64 | const options = program.opts() | ||
65 | |||
66 | // ---------------------------------------------------------------------------- | 63 | // ---------------------------------------------------------------------------- |
67 | 64 | ||
68 | async function pluginsListCLI () { | 65 | async 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 |