Skip to content
This repository has been archived by the owner on May 24, 2020. It is now read-only.

Commit

Permalink
Update version info to be more human-readable
Browse files Browse the repository at this point in the history
  • Loading branch information
arxanas committed Jul 16, 2016
1 parent 1faa901 commit c048c51
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions config.server.js.default
Original file line number Diff line number Diff line change
@@ -1,9 1,24 @@
'use strict';

const execSync = require('child_process').execSync

const VERSION = execSync('git describe')
let versionInfo = execSync('git describe --always --long')
.toString()
.trim()
.replace('-', '/')
let versionInfoParts = versionInfo.split('-')

const VERSION =
versionInfoParts.length === 3

// Show the number of commits past the most recent tag, and the commit hash
// identifier. For example, `v2.0.0 3 (123abc)` indicates three commits past
// version 2.0.0, at commit `123abc`. (In the `git-describe` output, there is
// always a `g` before the commit hash, which stands for 'git', so we remove
// that.)
? `${versionInfoParts[0]} ${versionInfoParts[1]} (${versionInfoParts[2].slice(1)})`

// If there is no tag, just display the commit hash.
: versionInfo

module.exports = {
PORT: 1337,
Expand Down

0 comments on commit c048c51

Please sign in to comment.