From 8704acf49efc770d73bf07c10468ed8c74d28a83 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Thu, 13 Sep 2018 14:27:44 +0200 Subject: one cli to unite them all MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ash nazg thrakatulûk agh burzum-ishi krimpatul - refactor import-videos to use the youtubeDL helper - add very basic tests for the cli --- server/tools/get-access-token.ts | 48 ---------------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 server/tools/get-access-token.ts (limited to 'server/tools/get-access-token.ts') diff --git a/server/tools/get-access-token.ts b/server/tools/get-access-token.ts deleted file mode 100644 index d86c84c8d..000000000 --- a/server/tools/get-access-token.ts +++ /dev/null @@ -1,48 +0,0 @@ -import * as program from 'commander' - -import { - getClient, - serverLogin, - Server, - Client, - User -} from '../tests/utils/index' - -program - .option('-u, --url ', 'Server url') - .option('-n, --username ', 'Username') - .option('-p, --password ', 'Password') - .parse(process.argv) - -if ( - !program['url'] || - !program['username'] || - !program['password'] -) { - throw new Error('All arguments are required.') -} - -getClient(program.url) - .then(res => { - const server = { - url: 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 - } as Server - - return serverLogin(server) - }) - .then(accessToken => { - console.log(accessToken) - process.exit(0) - }) - .catch(err => { - console.error(err) - process.exit(-1) - }) -- cgit v1.2.3