mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
22 lines
504 B
JavaScript
22 lines
504 B
JavaScript
var simple = require('simple-git');
|
|
var services = require('./sharelatex/config/services');
|
|
const fs = require('fs');
|
|
|
|
function print_latest(repoDir) {
|
|
git = simple(repoDir);
|
|
opt = [];
|
|
opt['max-count'] = 1;
|
|
git.log(opt, function(err, log) {
|
|
if (!err) {
|
|
console.log(repoDir + ',' + log.latest.hash);
|
|
}
|
|
})
|
|
}
|
|
|
|
for (id in services) {
|
|
service = services[id];
|
|
dirPath = __dirname + '/sharelatex/'+service.name;
|
|
if (fs.existsSync(dirPath)) {
|
|
print_latest(dirPath);
|
|
}
|
|
}
|