mirror of
https://gitlab.com/Shinobi-Systems/ShinobiCE.git
synced 2025-03-09 15:40:15 +00:00
Shinobi CE officially lands on Gitlab
This commit is contained in:
commit
f1406d4eec
431 changed files with 118157 additions and 0 deletions
23
tools/getVersionFromGit.js
Normal file
23
tools/getVersionFromGit.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
var fs = require('fs');
|
||||
var branch = fs.readFileSync(__dirname+'/../.git/HEAD','utf8').replace('ref: refs/heads/','');
|
||||
var version = fs.readFileSync(__dirname+'/../.git/FETCH_HEAD','utf8').split('\t')[0];
|
||||
var rawLogRows = fs.readFileSync(__dirname+'/../.git/logs/HEAD','utf8').split('\t');
|
||||
var prettyLog = [];
|
||||
|
||||
rawLogRows.forEach(function(logRow,n){
|
||||
var log = logRow.split('\n')[1].replace('\n','')
|
||||
if(log){
|
||||
var log = log.split(' ')
|
||||
prettyLog.push({
|
||||
version:log[1],
|
||||
lastVersion:log[0],
|
||||
time:log[4],
|
||||
timezone:log[5]
|
||||
})
|
||||
}
|
||||
})
|
||||
module.exports = {
|
||||
version:version,
|
||||
branch:branch,
|
||||
log:prettyLog,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue