X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftools%2Fpeertube-plugins.ts;h=cb591377ba29d7ed48a8c02dd05fa79270e9a7f2;hb=428ccb8b7a44ce60cabb7401a5464cf5fcbd4dba;hp=08e8cd713d5bf038e711d8bedd01ab1a0e3fef74;hpb=ba5a8d89bbf049e4afc41543bcc072cccdb02669;p=github%2FChocobozzz%2FPeerTube.git 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' registerTSPaths() import * as program from 'commander' -import { PluginType } from '../../shared/models/plugins/plugin.type' import { installPlugin, listPlugins, uninstallPlugin, updatePlugin } from '../../shared/extra-utils/server/plugins' import { getAdminTokenOrDie, getServerCredentials } from './cli' -import { PeerTubePlugin } from '../../shared/models/plugins/peertube-plugin.model' +import { PeerTubePlugin, PluginType } from '../../shared/models' import { isAbsolute } from 'path' import * as CliTable3 from 'cli-table3' import commander = require('commander') @@ -24,7 +23,7 @@ program .option('-p, --password ', 'Password') .option('-t, --only-themes', 'List themes only') .option('-P, --only-plugins', 'List plugins only') - .action(() => pluginsListCLI()) + .action((options, command) => pluginsListCLI(command, options)) program .command('install') @@ -61,12 +60,10 @@ if (!process.argv.slice(2).length) { program.parse(process.argv) -const options = program.opts() - // ---------------------------------------------------------------------------- -async function pluginsListCLI () { - const { url, username, password } = await getServerCredentials(program) +async function pluginsListCLI (command: commander.CommanderStatic, options: commander.OptionValues) { + const { url, username, password } = await getServerCredentials(command) const accessToken = await getAdminTokenOrDie(url, username, password) let pluginType: PluginType