aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/cli.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-25 17:48:27 +0200
committerChocobozzz <me@florianbigard.com>2021-06-25 17:48:27 +0200
commit12152aa09ff47dc5c5a627c27030855e254e58ad (patch)
tree3b630bce33bd62a21da4a10c3ac62189eabcb8a6 /server/tools/cli.ts
parent8cc6120118a9fb75b3165c9f84b2d0068d1ade72 (diff)
downloadPeerTube-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.ts10
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'
3import { join } from 'path' 3import { join } from 'path'
4import { root } from '../../shared/extra-utils/miscs/miscs' 4import { root } from '../../shared/extra-utils/miscs/miscs'
5import { getVideoChannel } from '../../shared/extra-utils/videos/video-channels' 5import { getVideoChannel } from '../../shared/extra-utils/videos/video-channels'
6import { CommanderStatic } from 'commander'
7import { VideoChannel, VideoPrivacy } from '../../shared/models/videos' 6import { VideoChannel, VideoPrivacy } from '../../shared/models/videos'
8import { createLogger, format, transports } from 'winston' 7import { createLogger, format, transports } from 'winston'
9import { getMyUserInformation } from '@shared/extra-utils/users/users' 8import { getMyUserInformation } from '@shared/extra-utils/users/users'
10import { User, UserRole } from '@shared/models' 9import { User, UserRole } from '@shared/models'
11import { getAccessToken } from '@shared/extra-utils/users/login' 10import { getAccessToken } from '@shared/extra-utils/users/login'
11import { Command } from 'commander'
12 12
13let configName = 'PeerTube/CLI' 13let configName = 'PeerTube/CLI'
14if (isTestInstance()) configName += `-${getAppNumber()}` 14if (isTestInstance()) configName += `-${getAppNumber()}`
@@ -69,7 +69,7 @@ function deleteSettings () {
69} 69}
70 70
71function getRemoteObjectOrDie ( 71function 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
109function buildCommonVideoOptions (command: CommanderStatic) { 109function 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
131async function buildVideoAttributesFromCommander (url: string, command: CommanderStatic, defaultAttributes: any = {}) { 131async 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
180function getServerCredentials (program: CommanderStatic) { 180function 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)