diff --git a/app.js b/app.js index 783f391..fb68999 100755 --- a/app.js +++ b/app.js @@ -101,6 +101,13 @@ app.runOnStartup = function() { }); } + if (global.sourcecodeVersion == null) { + simpleGit(".").log(["-n 1"], function(err, log) { + global.sourcecodeVersion = log.all[0].hash.substring(0, 10); + global.sourcecodeDate = log.all[0].date.substring(0, "0000-00-00".length); + }); + } + if (global.exchangeRate == null) { refreshExchangeRate(); } @@ -109,9 +116,6 @@ app.runOnStartup = function() { setInterval(refreshExchangeRate, 1800000); }; - -app.locals.sourcecodeVersion = null; - app.use(function(req, res, next) { // make session available in templates res.locals.session = req.session; @@ -162,12 +166,6 @@ app.use(function(req, res, next) { } } - if (!req.session.sourcecodeVersion) { - simpleGit(".").log(["-n 1"], function(err, log) { - app.locals.sourcecodeVersion = log.all[0].hash.substring(0, 10); - }); - } - if (req.session.userMessage) { res.locals.userMessage = req.session.userMessage; diff --git a/views/layout.pug b/views/layout.pug index 5e1bfff..9a0beac 100644 --- a/views/layout.pug +++ b/views/layout.pug @@ -102,6 +102,7 @@ html dt Running Version dd a(href=("https://github.com/janoside/btc-rpc-explorer/commit/" + sourcecodeVersion)) #{sourcecodeVersion} + span(style="color: #ccc;") (#{sourcecodeDate}) if (env.demoSite) dt Public Demos