swh:1:snp:3af1a03cd091600016317ad7197cfc7dfd1319c7
Tip revision: 52d7b5872ead99aa069d8d6bd911147f3db6fbed authored by Andreas Stuhlmueller on 09 November 2017, 01:26:36 UTC
0.9.11
0.9.11
Tip revision: 52d7b58
git.js
'use strict';
var execSync = require('child_process').execSync;
function git(cmd) {
return function(dir) {
var options = { cwd: dir, stdio: [] };
return execSync('git ' + cmd, options).toString().trim();
};
}
function catchAll(fn) {
return function(arg) {
try {
return fn(arg);
} catch (e) {
return '';
}
};
}
module.exports = {
short: catchAll(git('rev-parse --short HEAD')),
branch: catchAll(git('rev-parse --abbrev-ref HEAD'))
};