aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
authorFlorent Fayolle <florent.fayolle69@gmail.com>2018-06-02 21:39:41 +0200
committerChocobozzz <me@florianbigard.com>2018-06-07 08:57:48 +0200
commit0138af9237b77dd7d3a49260d164193b4048de84 (patch)
tree5a377c7577cd99d5b324967187e10cd9fcc81383 /server/helpers
parent157b62b1f4450c32bb7383ccacbea555ec607013 (diff)
downloadPeerTube-0138af9237b77dd7d3a49260d164193b4048de84.tar.gz
PeerTube-0138af9237b77dd7d3a49260d164193b4048de84.tar.zst
PeerTube-0138af9237b77dd7d3a49260d164193b4048de84.zip
Add create-import-video-file-job command
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/core-utils.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/helpers/core-utils.ts b/server/helpers/core-utils.ts
index a3dfe27b5..c560222d3 100644
--- a/server/helpers/core-utils.ts
+++ b/server/helpers/core-utils.ts
@@ -6,7 +6,7 @@
6import * as bcrypt from 'bcrypt' 6import * as bcrypt from 'bcrypt'
7import * as createTorrent from 'create-torrent' 7import * as createTorrent from 'create-torrent'
8import { pseudoRandomBytes } from 'crypto' 8import { pseudoRandomBytes } from 'crypto'
9import { readdir, readFile, rename, stat, Stats, unlink, writeFile } from 'fs' 9import { copyFile, readdir, readFile, rename, stat, Stats, unlink, writeFile } from 'fs'
10import * as mkdirp from 'mkdirp' 10import * as mkdirp from 'mkdirp'
11import { isAbsolute, join } from 'path' 11import { isAbsolute, join } from 'path'
12import * as pem from 'pem' 12import * as pem from 'pem'
@@ -136,6 +136,7 @@ function promisify2WithVoid<T, U> (func: (arg1: T, arg2: U, cb: (err: any) => vo
136 } 136 }
137} 137}
138 138
139const copyFilePromise = promisify2WithVoid<string, string>(copyFile)
139const readFileBufferPromise = promisify1<string, Buffer>(readFile) 140const readFileBufferPromise = promisify1<string, Buffer>(readFile)
140const unlinkPromise = promisify1WithVoid<string>(unlink) 141const unlinkPromise = promisify1WithVoid<string>(unlink)
141const renamePromise = promisify2WithVoid<string, string>(rename) 142const renamePromise = promisify2WithVoid<string, string>(rename)
@@ -167,6 +168,7 @@ export {
167 promisify0, 168 promisify0,
168 promisify1, 169 promisify1,
169 170
171 copyFilePromise,
170 readdirPromise, 172 readdirPromise,
171 readFileBufferPromise, 173 readFileBufferPromise,
172 unlinkPromise, 174 unlinkPromise,