diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2018-09-29 19:53:49 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-10-01 14:31:01 +0200 |
commit | abb2c7927ca1640a755e0ec32c51bcc9c873b34c (patch) | |
tree | 4ded5e7559d48d450f861f5ec5c0a1a794cc2e15 /server/tools/cli.ts | |
parent | 26b415176212b44ff6ce168cb00aeb93b10c0cb3 (diff) | |
download | PeerTube-abb2c7927ca1640a755e0ec32c51bcc9c873b34c.tar.gz PeerTube-abb2c7927ca1640a755e0ec32c51bcc9c873b34c.tar.zst PeerTube-abb2c7927ca1640a755e0ec32c51bcc9c873b34c.zip |
show last commit hash alongside server version in footer
Diffstat (limited to 'server/tools/cli.ts')
-rw-r--r-- | server/tools/cli.ts | 13 |
1 files changed, 2 insertions, 11 deletions
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 @@ | |||
1 | const config = require('application-config')('PeerTube/CLI') | 1 | const config = require('application-config')('PeerTube/CLI') |
2 | const netrc = require('netrc-parser').default | 2 | const netrc = require('netrc-parser').default |
3 | import { getVersion } from '../helpers/utils' | ||
3 | 4 | ||
4 | const version = () => { | 5 | const version = getVersion |
5 | const tag = require('child_process') | ||
6 | .execSync('[[ ! -d .git ]] || git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || true', { stdio: [0,1,2] }) | ||
7 | if (tag) return tag | ||
8 | |||
9 | const version = require('child_process') | ||
10 | .execSync('[[ ! -d .git ]] || git rev-parse --short HEAD').toString().trim() | ||
11 | if (version) return version | ||
12 | |||
13 | return require('../../../package.json').version | ||
14 | } | ||
15 | 6 | ||
16 | let settings = { | 7 | let settings = { |
17 | remotes: [], | 8 | remotes: [], |