import { access, constants } from 'fs-extra'
import { isAbsolute } from 'path'
import { getAccessToken } from '../../shared/extra-utils'
import { access, constants } from 'fs-extra'
import { isAbsolute } from 'path'
import { getAccessToken } from '../../shared/extra-utils'
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 (!options.videoName || !options.file) {
+ if (!options.videoName) console.error('--video-name is required.')
+ if (!options.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: options.file,
+ thumbnailfile: options.thumbnail,
+ previewfile: options.preview