log Shinobi version on start and show in Superuser panel+

merge-requests/81/head
Moe 2019-07-29 13:10:08 -07:00
parent 6b246c0a30
commit 934159786a
1 changed files with 10 additions and 6 deletions

View File

@ -2,12 +2,16 @@ var exec = require('child_process').exec
module.exports = function(s,config,lang,app,io){
var getRepositoryCommitId = function(callback){
exec(`git rev-parse HEAD`,function(err,response){
var data = response.toString()
var isGitRespository = false
if(data.indexOf('not a git repository') === -1){
s.currentVersion = data
isGitRespository = true
s.systemLog(`Current Version : ${s.currentVersion}`)
if(response){
var data = response.toString()
var isGitRespository = false
if(data.indexOf('not a git repository') === -1){
s.currentVersion = data
isGitRespository = true
s.systemLog(`Current Version : ${s.currentVersion}`)
}
}else if(err){
s.debugLog('Git is not installed.')
}
if(callback)callback(!isGitRespository,data)
})