diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-25 17:48:27 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-25 17:48:27 +0200 |
commit | 12152aa09ff47dc5c5a627c27030855e254e58ad (patch) | |
tree | 3b630bce33bd62a21da4a10c3ac62189eabcb8a6 /server/tools/cli.ts | |
parent | 8cc6120118a9fb75b3165c9f84b2d0068d1ade72 (diff) | |
download | PeerTube-12152aa09ff47dc5c5a627c27030855e254e58ad.tar.gz PeerTube-12152aa09ff47dc5c5a627c27030855e254e58ad.tar.zst PeerTube-12152aa09ff47dc5c5a627c27030855e254e58ad.zip |
Update tools dependencies
Diffstat (limited to 'server/tools/cli.ts')
-rw-r--r-- | server/tools/cli.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/tools/cli.ts b/server/tools/cli.ts index cc89fe46e..7b94306cd 100644 --- a/server/tools/cli.ts +++ b/server/tools/cli.ts | |||
@@ -3,12 +3,12 @@ import { getAppNumber, isTestInstance } from '../helpers/core-utils' | |||
3 | import { join } from 'path' | 3 | import { join } from 'path' |
4 | import { root } from '../../shared/extra-utils/miscs/miscs' | 4 | import { root } from '../../shared/extra-utils/miscs/miscs' |
5 | import { getVideoChannel } from '../../shared/extra-utils/videos/video-channels' | 5 | import { getVideoChannel } from '../../shared/extra-utils/videos/video-channels' |
6 | import { CommanderStatic } from 'commander' | ||
7 | import { VideoChannel, VideoPrivacy } from '../../shared/models/videos' | 6 | import { VideoChannel, VideoPrivacy } from '../../shared/models/videos' |
8 | import { createLogger, format, transports } from 'winston' | 7 | import { createLogger, format, transports } from 'winston' |
9 | import { getMyUserInformation } from '@shared/extra-utils/users/users' | 8 | import { getMyUserInformation } from '@shared/extra-utils/users/users' |
10 | import { User, UserRole } from '@shared/models' | 9 | import { User, UserRole } from '@shared/models' |
11 | import { getAccessToken } from '@shared/extra-utils/users/login' | 10 | import { getAccessToken } from '@shared/extra-utils/users/login' |
11 | import { Command } from 'commander' | ||
12 | 12 | ||
13 | let configName = 'PeerTube/CLI' | 13 | let configName = 'PeerTube/CLI' |
14 | if (isTestInstance()) configName += `-${getAppNumber()}` | 14 | if (isTestInstance()) configName += `-${getAppNumber()}` |
@@ -69,7 +69,7 @@ function deleteSettings () { | |||
69 | } | 69 | } |
70 | 70 | ||
71 | function getRemoteObjectOrDie ( | 71 | function getRemoteObjectOrDie ( |
72 | program: CommanderStatic, | 72 | program: Command, |
73 | settings: Settings, | 73 | settings: Settings, |
74 | netrc: Netrc | 74 | netrc: Netrc |
75 | ): { url: string, username: string, password: string } { | 75 | ): { url: string, username: string, password: string } { |
@@ -106,7 +106,7 @@ function getRemoteObjectOrDie ( | |||
106 | } | 106 | } |
107 | } | 107 | } |
108 | 108 | ||
109 | function buildCommonVideoOptions (command: CommanderStatic) { | 109 | function buildCommonVideoOptions (command: Command) { |
110 | function list (val) { | 110 | function list (val) { |
111 | return val.split(',') | 111 | return val.split(',') |
112 | } | 112 | } |
@@ -128,7 +128,7 @@ function buildCommonVideoOptions (command: CommanderStatic) { | |||
128 | .option('-v, --verbose <verbose>', 'Verbosity, from 0/\'error\' to 4/\'debug\'', 'info') | 128 | .option('-v, --verbose <verbose>', 'Verbosity, from 0/\'error\' to 4/\'debug\'', 'info') |
129 | } | 129 | } |
130 | 130 | ||
131 | async function buildVideoAttributesFromCommander (url: string, command: CommanderStatic, defaultAttributes: any = {}) { | 131 | async function buildVideoAttributesFromCommander (url: string, command: Command, defaultAttributes: any = {}) { |
132 | const options = command.opts() | 132 | const options = command.opts() |
133 | 133 | ||
134 | const defaultBooleanAttributes = { | 134 | const defaultBooleanAttributes = { |
@@ -177,7 +177,7 @@ async function buildVideoAttributesFromCommander (url: string, command: Commande | |||
177 | return videoAttributes | 177 | return videoAttributes |
178 | } | 178 | } |
179 | 179 | ||
180 | function getServerCredentials (program: CommanderStatic) { | 180 | function getServerCredentials (program: Command) { |
181 | return Promise.all([ getSettings(), getNetrc() ]) | 181 | return Promise.all([ getSettings(), getNetrc() ]) |
182 | .then(([ settings, netrc ]) => { | 182 | .then(([ settings, netrc ]) => { |
183 | return getRemoteObjectOrDie(program, settings, netrc) | 183 | return getRemoteObjectOrDie(program, settings, netrc) |