mirror of
https://gitlab.com/Shinobi-Systems/ShinobiCE.git
synced 2025-03-09 15:40:15 +00:00
Support Shinobi at https://licenses.shinobi.video/subscribe
This commit is contained in:
parent
ef40f3f231
commit
167603dfb0
118 changed files with 16152 additions and 5441 deletions
20
libs/version.js
Normal file
20
libs/version.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
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){
|
||||
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)
|
||||
})
|
||||
}
|
||||
getRepositoryCommitId()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue