import { join } from 'path'
import { root } from '../../shared/extra-utils/miscs/miscs'
import { getVideoChannel } from '../../shared/extra-utils/videos/video-channels'
-import { CommanderStatic } from 'commander'
import { VideoChannel, VideoPrivacy } from '../../shared/models/videos'
import { createLogger, format, transports } from 'winston'
import { getMyUserInformation } from '@shared/extra-utils/users/users'
import { User, UserRole } from '@shared/models'
import { getAccessToken } from '@shared/extra-utils/users/login'
+import { Command } from 'commander'
let configName = 'PeerTube/CLI'
if (isTestInstance()) configName += `-${getAppNumber()}`
}
function getRemoteObjectOrDie (
- program: CommanderStatic,
+ program: Command,
settings: Settings,
netrc: Netrc
): { url: string, username: string, password: string } {
}
}
-function buildCommonVideoOptions (command: CommanderStatic) {
+function buildCommonVideoOptions (command: Command) {
function list (val) {
return val.split(',')
}
.option('-v, --verbose <verbose>', 'Verbosity, from 0/\'error\' to 4/\'debug\'', 'info')
}
-async function buildVideoAttributesFromCommander (url: string, command: CommanderStatic, defaultAttributes: any = {}) {
+async function buildVideoAttributesFromCommander (url: string, command: Command, defaultAttributes: any = {}) {
const options = command.opts()
const defaultBooleanAttributes = {
return videoAttributes
}
-function getServerCredentials (program: CommanderStatic) {
+function getServerCredentials (program: Command) {
return Promise.all([ getSettings(), getNetrc() ])
.then(([ settings, netrc ]) => {
return getRemoteObjectOrDie(program, settings, netrc)