From d0a0fa429d4651710ed951a3c11af0219e408964 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 13 Jul 2021 11:44:16 +0200 Subject: Adapt CLI to new commands --- server/tools/peertube-plugins.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'server/tools/peertube-plugins.ts') diff --git a/server/tools/peertube-plugins.ts b/server/tools/peertube-plugins.ts index 63541bf2c..22a09b779 100644 --- a/server/tools/peertube-plugins.ts +++ b/server/tools/peertube-plugins.ts @@ -4,7 +4,7 @@ import { registerTSPaths } from '../helpers/register-ts-paths' registerTSPaths() import { program, Command, OptionValues } from 'commander' -import { buildServer, getAdminTokenOrDie, getServerCredentials } from './cli' +import { assignToken, buildServer, getServerCredentials } from './cli' import { PluginType } from '../../shared/models' import { isAbsolute } from 'path' import * as CliTable3 from 'cli-table3' @@ -62,8 +62,8 @@ program.parse(process.argv) async function pluginsListCLI (command: Command, options: OptionValues) { const { url, username, password } = await getServerCredentials(command) - const token = await getAdminTokenOrDie(url, username, password) - const server = buildServer(url, token) + const server = buildServer(url) + await assignToken(server, username, password) let pluginType: PluginType if (options.onlyThemes) pluginType = PluginType.THEME @@ -105,8 +105,8 @@ async function installPluginCLI (command: Command, options: OptionValues) { } const { url, username, password } = await getServerCredentials(command) - const token = await getAdminTokenOrDie(url, username, password) - const server = buildServer(url, token) + const server = buildServer(url) + await assignToken(server, username, password) try { await server.pluginsCommand.install({ npmName: options.npmName, path: options.path }) @@ -132,8 +132,8 @@ async function updatePluginCLI (command: Command, options: OptionValues) { } const { url, username, password } = await getServerCredentials(command) - const token = await getAdminTokenOrDie(url, username, password) - const server = buildServer(url, token) + const server = buildServer(url) + await assignToken(server, username, password) try { await server.pluginsCommand.update({ npmName: options.npmName, path: options.path }) @@ -154,8 +154,8 @@ async function uninstallPluginCLI (command: Command, options: OptionValues) { } const { url, username, password } = await getServerCredentials(command) - const token = await getAdminTokenOrDie(url, username, password) - const server = buildServer(url, token) + const server = buildServer(url) + await assignToken(server, username, password) try { await server.pluginsCommand.uninstall({ npmName: options.npmName }) -- cgit v1.2.3