From abb2c7927ca1640a755e0ec32c51bcc9c873b34c Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Sat, 29 Sep 2018 19:53:49 +0200 Subject: show last commit hash alongside server version in footer --- server/tools/cli.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'server/tools') diff --git a/server/tools/cli.ts b/server/tools/cli.ts index 9a170d4da..87d1512a3 100644 --- a/server/tools/cli.ts +++ b/server/tools/cli.ts @@ -1,17 +1,8 @@ const config = require('application-config')('PeerTube/CLI') const netrc = require('netrc-parser').default +import { getVersion } from '../helpers/utils' -const version = () => { - const tag = require('child_process') - .execSync('[[ ! -d .git ]] || git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || true', { stdio: [0,1,2] }) - if (tag) return tag - - const version = require('child_process') - .execSync('[[ ! -d .git ]] || git rev-parse --short HEAD').toString().trim() - if (version) return version - - return require('../../../package.json').version -} +const version = getVersion let settings = { remotes: [], -- cgit v1.2.3