1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 10:19:35 +02:00

Check ffmepg version on startup

This commit is contained in:
Chocobozzz 2021-03-11 09:51:08 +01:00
parent db8b2f56c0
commit ae71acca14
No known key found for this signature in database
GPG key ID: 583A612D890159BE
5 changed files with 60 additions and 16 deletions

View file

@ -251,6 +251,16 @@ function promisify2<T, U, A> (func: (arg1: T, arg2: U, cb: (err: any, result: A)
}
}
function parseSemVersion (s: string) {
const parsed = s.match(/^v?(\d+)\.(\d+)\.(\d+)$/i)
return {
major: parseInt(parsed[1]),
minor: parseInt(parsed[2]),
patch: parseInt(parsed[3])
}
}
const randomBytesPromise = promisify1<number, Buffer>(randomBytes)
const createPrivateKey = promisify1<number, { key: string }>(pem.createPrivateKey)
const getPublicKey = promisify1<string, { publicKey: string }>(pem.getPublicKey)
@ -288,5 +298,7 @@ export {
getPublicKey,
execPromise2,
execPromise,
pipelinePromise
pipelinePromise,
parseSemVersion
}