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

Optimize config endpoint

This commit is contained in:
Chocobozzz 2018-11-23 11:06:10 +01:00
parent f95cb03a29
commit 1b5e2d7290
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 9 additions and 12 deletions

View file

@ -57,7 +57,7 @@ function getSecureTorrentName (originalName: string) {
return sha256(originalName) + '.torrent'
}
async function getVersion () {
async function getServerCommit () {
try {
const tag = await execPromise2(
'[ ! -d .git ] || git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || true',
@ -77,7 +77,7 @@ async function getVersion () {
logger.debug('Cannot get version from git HEAD.', { err })
}
return require('../../../package.json').version
return ''
}
/**
@ -102,7 +102,7 @@ export {
getFormattedObjects,
getSecureTorrentName,
getServerActor,
getVersion,
getServerCommit,
generateVideoTmpPath,
getUUIDFromFilename
}