From 1a12f66d631d28a5a58ebbcd274426f2e6e5d203 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 13 Jun 2019 11:09:38 +0200 Subject: Add more CLI tests --- server/tools/peertube-get-access-token.ts | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 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 85660de2c..103495347 100644 --- a/server/tools/peertube-get-access-token.ts +++ b/server/tools/peertube-get-access-token.ts @@ -1,12 +1,5 @@ import * as program from 'commander' - -import { - getClient, - serverLogin, - Server, - Client, - User -} from '../../shared/extra-utils' +import { getClient, Server, serverLogin } from '../../shared/extra-utils' program .option('-u, --url ', 'Server url') @@ -22,6 +15,7 @@ if ( if (!program['url']) console.error('--url field is required.') if (!program['username']) console.error('--username field is required.') if (!program['password']) console.error('--password field is required.') + process.exit(-1) } @@ -32,11 +26,11 @@ getClient(program.url) user: { username: program['username'], password: program['password'] - } as User, + }, client: { - id: res.body.client_id as string, - secret: res.body.client_secret as string - } as Client + id: res.body.client_id, + secret: res.body.client_secret + } } as Server return serverLogin(server) -- cgit v1.2.3