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-get-access-token.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'server/tools/peertube-get-access-token.ts') diff --git a/server/tools/peertube-get-access-token.ts b/server/tools/peertube-get-access-token.ts index 5868d0548..a67de9180 100644 --- a/server/tools/peertube-get-access-token.ts +++ b/server/tools/peertube-get-access-token.ts @@ -2,7 +2,7 @@ import { registerTSPaths } from '../helpers/register-ts-paths' registerTSPaths() import { program } from 'commander' -import { getAccessToken } from '../../shared/extra-utils' +import { assignToken, buildServer } from './cli' program .option('-u, --url ', 'Server url') @@ -24,9 +24,11 @@ if ( process.exit(-1) } -getAccessToken(options.url, options.username, options.password) - .then(accessToken => { - console.log(accessToken) +const server = buildServer(options.url) + +assignToken(server, options.username, options.password) + .then(() => { + console.log(server.accessToken) process.exit(0) }) .catch(err => { -- cgit v1.2.3