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

Commit d81e52d

Browse files
committed
Add version number to startup message
1 parent f9a33a4 commit d81e52d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ var server = http.createServer(function(req, res) {
1616
var eioServer = eio(server).on('connection', router)
1717

1818
require('log-timestamp')
19-
console.log('Started up')
19+
console.log(`Started up ${CONFIG.VERSION.RELEASE}+${CONFIG.VERSION.LOCAL_BUILD}`)

config.server.js.default

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1+
const execSync = require('child_process').execSync
2+
3+
const RELEASE = execSync('git describe').toString().trim()
4+
const LOCAL_BUILD = parseInt(
5+
execSync('git rev-list --count "$(git describe)..HEAD"').toString().trim(),
6+
10)
7+
18
module.exports = {
29
PORT: 1337,
10+
VERSION: {RELEASE, LOCAL_BUILD},
311
STRINGS: {
412
BRANDING: {
513
DEFAULT_USERNAME: 'ninja',

0 commit comments

Comments
 (0)