This commit is contained in:
rkiel
2019-07-14 22:04:17 -04:00
parent 4c4a16af04
commit 604d3d84c4
4 changed files with 85 additions and 24 deletions

19
js/git.js Normal file
View File

@@ -0,0 +1,19 @@
const _ = require("lodash");
const path = x => require("../" + x);
const immutable = path("js/immutable");
const shell = path("js/shell");
let lib;
function setCurrentBranch(dp) {
const cmd = "git rev-parse --abbrev-ref HEAD";
return shell.capture(cmd).then(x => immutable.set(dp, "currentBranch", x));
}
lib = {
setCurrentBranch
};
module.exports = lib;