Files
git-utilities/js/git.js
2019-07-18 15:40:37 -04:00

20 lines
368 B
JavaScript

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, "branch.current", x));
}
lib = {
setCurrentBranch
};
module.exports = lib;