aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/upload.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tools/upload.ts')
-rw-r--r--server/tools/upload.ts5
1 files changed, 1 insertions, 4 deletions
diff --git a/server/tools/upload.ts b/server/tools/upload.ts
index b5630bb9c..796a0f723 100644
--- a/server/tools/upload.ts
+++ b/server/tools/upload.ts
@@ -1,13 +1,10 @@
1import * as program from 'commander' 1import * as program from 'commander'
2import { access, constants } from 'fs-extra' 2import { access, constants } from 'fs-extra'
3import { isAbsolute } from 'path' 3import { isAbsolute } from 'path'
4import { promisify } from 'util'
5import { getClient, login } from '../tests/utils' 4import { getClient, login } from '../tests/utils'
6import { uploadVideo } from '../tests/utils/index' 5import { uploadVideo } from '../tests/utils/index'
7import { VideoPrivacy } from '../../shared/models/videos' 6import { VideoPrivacy } from '../../shared/models/videos'
8 7
9const accessPromise = promisify(access)
10
11program 8program
12 .option('-u, --url <url>', 'Server url') 9 .option('-u, --url <url>', 'Server url')
13 .option('-U, --username <username>', 'Username') 10 .option('-U, --username <username>', 'Username')
@@ -68,7 +65,7 @@ async function run () {
68 const res2 = await login(program[ 'url' ], client, user) 65 const res2 = await login(program[ 'url' ], client, user)
69 const accessToken = res2.body.access_token 66 const accessToken = res2.body.access_token
70 67
71 await accessPromise(program[ 'file' ], constants.F_OK) 68 await access(program[ 'file' ], constants.F_OK)
72 69
73 console.log('Uploading %s video...', program[ 'videoName' ]) 70 console.log('Uploading %s video...', program[ 'videoName' ])
74 71