X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftools%2Fpeertube-auth.ts;h=c1a804f8311dc97b2bb8ea7d489c70aa35fdad0e;hb=7a9f9c46261062fb7b718395a8f71c1b742764d4;hp=6597a5c367e78d3d0c9a92f920c70ae990584db2;hpb=2aaa1a3fdc49be77aec5309dab5507865c38d392;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tools/peertube-auth.ts b/server/tools/peertube-auth.ts index 6597a5c36..c1a804f83 100644 --- a/server/tools/peertube-auth.ts +++ b/server/tools/peertube-auth.ts @@ -1,3 +1,5 @@ +// eslint-disable @typescript-eslint/no-unnecessary-type-assertion + import { registerTSPaths } from '../helpers/register-ts-paths' registerTSPaths() @@ -5,9 +7,8 @@ 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() ]) @@ -108,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 @@ -132,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)