import * as program from 'commander'
import { access, constants } from 'fs-extra'
import { isAbsolute } from 'path'
import * as program from 'commander'
import { access, constants } from 'fs-extra'
import { isAbsolute } from 'path'
getServerCredentials(command)
.then(({ url, username, password }) => {
getServerCredentials(command)
.then(({ url, username, password }) => {
- if (!program[ 'videoName' ] || !program[ 'file' ]) {
- if (!program[ 'videoName' ]) console.error('--video-name is required.')
- if (!program[ 'file' ]) console.error('--file is required.')
+ if (!program['videoName'] || !program['file']) {
+ if (!program['videoName']) console.error('--video-name is required.')
+ if (!program['file']) console.error('--file is required.')
async function run (url: string, username: string, password: string) {
const accessToken = await getAccessToken(url, username, password)
async function run (url: string, username: string, password: string) {
const accessToken = await getAccessToken(url, username, password)
const videoAttributes = await buildVideoAttributesFromCommander(url, program)
Object.assign(videoAttributes, {
const videoAttributes = await buildVideoAttributesFromCommander(url, program)
Object.assign(videoAttributes, {
- fixture: program[ 'file' ],
- thumbnailfile: program[ 'thumbnail' ],
- previewfile: program[ 'preview' ]
+ fixture: program['file'],
+ thumbnailfile: program['thumbnail'],
+ previewfile: program['preview']