X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftools%2Fpeertube-auth.ts;h=c1a804f8311dc97b2bb8ea7d489c70aa35fdad0e;hb=0502e3d0b66eb8ee7730c3a05275f54e283f60d7;hp=b5ecbd4706f1095079c1c88cc9f1c797e7e60b35;hpb=47e26ec7618554e996cfea4c2032a7ebffc21acc;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tools/peertube-auth.ts b/server/tools/peertube-auth.ts index b5ecbd470..c1a804f83 100644 --- a/server/tools/peertube-auth.ts +++ b/server/tools/peertube-auth.ts @@ -1,10 +1,14 @@ +// eslint-disable @typescript-eslint/no-unnecessary-type-assertion + +import { registerTSPaths } from '../helpers/register-ts-paths' +registerTSPaths() + import * as program from 'commander' import * as prompt from 'prompt' import { getNetrc, getSettings, writeSettings } from './cli' import { isUserUsernameValid } from '../helpers/custom-validators/users' -import { getAccessToken, login } from '../../shared/extra-utils' - -const Table = require('cli-table') +import { getAccessToken } from '../../shared/extra-utils' +import * as CliTable3 from 'cli-table3' async function delInstance (url: string) { const [ settings, netrc ] = await Promise.all([ getSettings(), getNetrc() ]) @@ -105,10 +109,10 @@ program .action(async () => { const [ settings, netrc ] = await Promise.all([ getSettings(), getNetrc() ]) - const table = new Table({ - head: ['instance', 'login'], - colWidths: [30, 30] - }) + const table = new CliTable3({ + head: [ 'instance', 'login' ], + colWidths: [ 30, 30 ] + }) as any settings.remotes.forEach(element => { if (!netrc.machines[element]) return @@ -129,7 +133,7 @@ program .description('set an existing entry as default') .action(async url => { const settings = await getSettings() - const instanceExists = settings.remotes.indexOf(url) !== -1 + const instanceExists = settings.remotes.includes(url) if (instanceExists) { settings.default = settings.remotes.indexOf(url)