swh:1:snp:3af1a03cd091600016317ad7197cfc7dfd1319c7
Tip revision: a3fae91cd54a992acb62e65ffeaff4332e0ea203 authored by Andreas Stuhlmueller on 01 December 2016, 11:47:06 UTC
0.9.6
0.9.6
Tip revision: a3fae91
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'))
};