diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-13 11:44:16 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | d0a0fa429d4651710ed951a3c11af0219e408964 (patch) | |
tree | c0638f2604e3442d1f15715b9b0f01ecab17ab20 /server/tools/peertube-get-access-token.ts | |
parent | 41d1d075011174e73dccb74006181a92a618d7b4 (diff) | |
download | PeerTube-d0a0fa429d4651710ed951a3c11af0219e408964.tar.gz PeerTube-d0a0fa429d4651710ed951a3c11af0219e408964.tar.zst PeerTube-d0a0fa429d4651710ed951a3c11af0219e408964.zip |
Adapt CLI to new commands
Diffstat (limited to 'server/tools/peertube-get-access-token.ts')
-rw-r--r-- | server/tools/peertube-get-access-token.ts | 10 |
1 files changed, 6 insertions, 4 deletions
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' | |||
2 | registerTSPaths() | 2 | registerTSPaths() |
3 | 3 | ||
4 | import { program } from 'commander' | 4 | import { program } from 'commander' |
5 | import { getAccessToken } from '../../shared/extra-utils' | 5 | import { assignToken, buildServer } from './cli' |
6 | 6 | ||
7 | program | 7 | program |
8 | .option('-u, --url <url>', 'Server url') | 8 | .option('-u, --url <url>', 'Server url') |
@@ -24,9 +24,11 @@ if ( | |||
24 | process.exit(-1) | 24 | process.exit(-1) |
25 | } | 25 | } |
26 | 26 | ||
27 | getAccessToken(options.url, options.username, options.password) | 27 | const server = buildServer(options.url) |
28 | .then(accessToken => { | 28 | |
29 | console.log(accessToken) | 29 | assignToken(server, options.username, options.password) |
30 | .then(() => { | ||
31 | console.log(server.accessToken) | ||
30 | process.exit(0) | 32 | process.exit(0) |
31 | }) | 33 | }) |
32 | .catch(err => { | 34 | .catch(err => { |