From 0138af9237b77dd7d3a49260d164193b4048de84 Mon Sep 17 00:00:00 2001 From: Florent Fayolle Date: Sat, 2 Jun 2018 21:39:41 +0200 Subject: Add create-import-video-file-job command --- server/helpers/core-utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server/helpers') 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 @@ import * as bcrypt from 'bcrypt' import * as createTorrent from 'create-torrent' import { pseudoRandomBytes } from 'crypto' -import { readdir, readFile, rename, stat, Stats, unlink, writeFile } from 'fs' +import { copyFile, readdir, readFile, rename, stat, Stats, unlink, writeFile } from 'fs' import * as mkdirp from 'mkdirp' import { isAbsolute, join } from 'path' import * as pem from 'pem' @@ -136,6 +136,7 @@ function promisify2WithVoid (func: (arg1: T, arg2: U, cb: (err: any) => vo } } +const copyFilePromise = promisify2WithVoid(copyFile) const readFileBufferPromise = promisify1(readFile) const unlinkPromise = promisify1WithVoid(unlink) const renamePromise = promisify2WithVoid(rename) @@ -167,6 +168,7 @@ export { promisify0, promisify1, + copyFilePromise, readdirPromise, readFileBufferPromise, unlinkPromise, -- cgit v1.2.3